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

Applications: Improve FSAC error message handling

Fixes apps showing redundant error messages and terminating
unnecessarily on failed file requests. It's nicer to drop the
user off at the equivalent of a default document on failure if
possible.

Also fixes TextEditor not showing response errors for missing files
in the recently opened list.
This commit is contained in:
thankyouverycool 2023-05-18 08:50:38 -04:00 committed by Andreas Kling
parent fef594708e
commit 444470b238
5 changed files with 17 additions and 19 deletions

View file

@ -75,9 +75,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (!image_file.is_empty()) {
auto response = FileSystemAccessClient::Client::the().request_file_read_only_approved(window, image_file);
if (response.is_error())
return 1;
main_widget->open_image(response.release_value());
if (!response.is_error())
main_widget->open_image(response.release_value());
else
TRY(main_widget->create_default_image());
} else {
TRY(main_widget->create_default_image());
}