Implement filesystem_error::what() and improve reporting.

This patch implements the `what()` for filesystem errors. The message
includes the 'what_arg', any paths that were specified, and the
error code message.

Additionally this patch refactors how errors are created, making it easier
to report them correctly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337664 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2018-07-23 02:00:52 +00:00
parent e14f03815b
commit 0ddb77a467
15 changed files with 706 additions and 434 deletions

View File

@@ -80,7 +80,8 @@ TEST_CASE(last_write_time_not_representable_error) {
TEST_CHECK(last_write_time(file, ec) == file_time_type::min());
TEST_CHECK(ErrorIs(ec, expected_err));
ExceptionChecker CheckExcept(file, expected_err);
ExceptionChecker CheckExcept(file, expected_err,
"directory_entry::last_write_time");
TEST_CHECK_THROW_RESULT(fs::filesystem_error, CheckExcept,
ent.last_write_time());