Make errors in Emu::Init verbose and don't crash

Allow TTY.log to be disabled if file access failed
Add fs::error::isdir
This commit is contained in:
Nekotekina 2019-09-23 20:37:58 +03:00
parent 9710473a2e
commit aa8a7b3e8a
4 changed files with 67 additions and 29 deletions

View file

@ -154,6 +154,7 @@ static fs::error to_error(int e)
case EACCES: return fs::error::acces;
case ENOTEMPTY: return fs::error::notempty;
case EROFS: return fs::error::readonly;
case EISDIR: return fs::error::isdir;
default: fmt::throw_exception("Unknown system error: %d.", e);
}
}
@ -1572,7 +1573,7 @@ bool fs::remove_all(const std::string& path, bool remove_root)
{
return false;
}
if (remove_root)
{
return remove_dir(path);
@ -1753,6 +1754,7 @@ void fmt_class_string<fs::error>::format(std::string& out, u64 arg)
case fs::error::acces: return "Access violation";
case fs::error::notempty: return "Not empty";
case fs::error::readonly: return "Read only";
case fs::error::isdir: return "Is a directory";
}
return unknown;