1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:44:58 +00:00

LibCore: Use ErrorOr<T> for Core::File::remove()

This function returns a subclass of Error, which is now possible.
This commit is contained in:
Andreas Kling 2021-11-07 01:31:00 +01:00
parent e253cf694e
commit c7e62d448c
5 changed files with 17 additions and 14 deletions

View file

@ -40,7 +40,7 @@ int main(int argc, char** argv)
auto result = Core::File::remove(path, recursive ? Core::File::RecursionMode::Allowed : Core::File::RecursionMode::Disallowed, force);
if (result.is_error()) {
warnln("rm: cannot remove '{}': {}", path, result.error().error_code);
warnln("rm: cannot remove '{}': {}", path, static_cast<Error const&>(result.error()));
had_errors = true;
}