mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
3DFileViewer: Properly handle ENOENT errors
This commit is contained in:
parent
8534506ab0
commit
e2b0cacb89
1 changed files with 3 additions and 2 deletions
|
@ -569,8 +569,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
window->show();
|
||||
|
||||
auto file = FileSystemAccessClient::Client::the().request_file_read_only_approved(window, filename);
|
||||
if (file.is_error() && file.error().code() != ENOENT) {
|
||||
GUI::MessageBox::show(window, DeprecatedString::formatted("Opening \"{}\" failed: {}", filename, strerror(errno)), "Error"sv, GUI::MessageBox::Type::Error);
|
||||
if (file.is_error()) {
|
||||
if (file.error().code() != ENOENT)
|
||||
GUI::MessageBox::show(window, DeprecatedString::formatted("Opening \"{}\" failed: {}", filename, strerror(errno)), "Error"sv, GUI::MessageBox::Type::Error);
|
||||
return 1;
|
||||
}
|
||||
widget->load_file(file.value().filename(), file.value().release_stream());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue