mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +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
|
@ -685,12 +685,12 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_delete_action()
|
|||
auto& error = result.error();
|
||||
if (is_directory) {
|
||||
GUI::MessageBox::show(window(),
|
||||
DeprecatedString::formatted("Removing directory {} from the project failed: {}", error.file, static_cast<Error const&>(error)),
|
||||
DeprecatedString::formatted("Removing directory {} from the project failed: {}", file, error),
|
||||
"Removal failed"sv,
|
||||
GUI::MessageBox::Type::Error);
|
||||
} else {
|
||||
GUI::MessageBox::show(window(),
|
||||
DeprecatedString::formatted("Removing file {} from the project failed: {}", error.file, static_cast<Error const&>(error)),
|
||||
DeprecatedString::formatted("Removing file {} from the project failed: {}", file, error),
|
||||
"Removal failed"sv,
|
||||
GUI::MessageBox::Type::Error);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue