0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-04 21:08:57 +01:00

ircd::mods: Throw fs::error rather than boost's filesystem_error.

This commit is contained in:
Jason Volk 2018-12-21 15:33:18 -08:00
parent 3c4591b121
commit d902269165

View file

@ -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))