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:
parent
7fa78b2456
commit
355e761a02
4 changed files with 10 additions and 18 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue