From d9022691657614aa6c5b0046d28f77887d246c7d Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 21 Dec 2018 15:33:18 -0800 Subject: [PATCH] ircd::mods: Throw fs::error rather than boost's filesystem_error. --- ircd/mods.cc | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/ircd/mods.cc b/ircd/mods.cc index de2574ebb..f49fabfdb 100644 --- a/ircd/mods.cc +++ b/ircd/mods.cc @@ -863,15 +863,18 @@ ircd::mods::info(const filesystem::path &path, F&& closure) { if(!exists(path)) - throw filesystem_error + throw fs::error { - "`%s' does not exist", path.string() + make_error_code(std::errc::no_such_file_or_directory), + "`%s' does not exist", + path.string() }; if(!is_regular_file(path)) - throw filesystem_error + throw fs::error { - "`%s' is not a file", path.string() + "`%s' is not a file", + path.string() }; boost::dll::library_info info(path); @@ -970,15 +973,20 @@ ircd::mods::paths::add(const string_view &dir) }; if(!exists(path)) - throw filesystem_error + throw fs::error { - "path `%s' (%s) does not exist", dir, path.string() + make_error_code(std::errc::no_such_file_or_directory), + "path `%s' (%s) does not exist", + dir, + path.string() }; if(!is_directory(path)) - throw filesystem_error + throw fs::error { - "path `%s' (%s) is not a directory", dir, path.string() + "path `%s' (%s) is not a directory", + dir, + path.string() }; if(added(dir))