mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 07:23:53 +01:00
ircd::mods: Throw fs::error rather than boost's filesystem_error.
This commit is contained in:
parent
3c4591b121
commit
d902269165
1 changed files with 16 additions and 8 deletions
24
ircd/mods.cc
24
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))
|
||||
|
|
Loading…
Reference in a new issue