1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:57:45 +00:00

LibCore: Let File::remove return a normal ErrorOr

Having the file path in there is nice, but it makes us incompatible with
comfortable error propagation in everything that isn't File::remove.
This commit is contained in:
Tim Schumacher 2022-12-23 13:59:27 +01:00 committed by Tim Flynn
parent 7fa78b2456
commit 355e761a02
4 changed files with 10 additions and 18 deletions

View file

@ -93,15 +93,7 @@ public:
static ErrorOr<DeprecatedString> read_link(DeprecatedString const& link_path);
static ErrorOr<void> link_file(DeprecatedString const& dst_path, DeprecatedString const& src_path);
struct RemoveError : public Error {
RemoveError(DeprecatedString f, int error_code)
: Error(error_code)
, file(move(f))
{
}
DeprecatedString file;
};
static ErrorOr<void, RemoveError> remove(DeprecatedString const& path, RecursionMode, bool force);
static ErrorOr<void> remove(DeprecatedString const& path, RecursionMode, bool force);
virtual bool open(OpenMode) override;