1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +00:00

FileSystemAccessServer: Use ECANCELED instead of -1

-1 was used when the user cancel the dialog, `ECANCELED` is a bit more
explicit about what it is.
This commit is contained in:
Lucas CHOLLET 2023-05-04 21:45:24 -04:00 committed by Sam Atkins
parent 8bb2663a22
commit 5a4c61838f
2 changed files with 2 additions and 2 deletions

View file

@ -122,7 +122,7 @@ void Client::handle_prompt_end(i32 request_id, i32 error, Optional<IPC::File> co
if (error != 0) {
// We don't want to show an error message for non-existent files since some applications may want
// to handle it as opening a new, named file.
if (error != -1 && error != ENOENT)
if (error != ECANCELED && error != ENOENT)
GUI::MessageBox::show_error(request_data.parent_window, DeprecatedString::formatted("Opening \"{}\" failed: {}", *chosen_file, strerror(error)));
request_data.promise->resolve(Error::from_errno(error)).release_value_but_fixme_should_propagate_errors();
return;