diff options
author | Lucas CHOLLET <lucas.chollet@free.fr> | 2022-04-18 17:39:37 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-04-20 12:01:49 +0200 |
commit | c741db967c72fd0c67d6fc344cd57668ede4de11 (patch) | |
tree | 47989b52713dde8ac6aa8e8abda41311808f8b67 | |
parent | ad8c6d858e0e422025f021389b5ccd0b5f71f31d (diff) | |
download | serenity-c741db967c72fd0c67d6fc344cd57668ede4de11.zip |
CrashReporter: Don't display an error when cancelling backtrace saving
Pressing the cancel button on the prompt displayed by try_save_file()
used to show an error.
-rw-r--r-- | Userland/Applications/CrashReporter/main.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp index 6fcc1f86b5..e7993e7874 100644 --- a/Userland/Applications/CrashReporter/main.cpp +++ b/Userland/Applications/CrashReporter/main.cpp @@ -284,13 +284,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) LexicalPath lexical_path(String::formatted("{}_{}_backtrace.txt", pid, app_name)); auto file_or_error = FileSystemAccessClient::Client::the().try_save_file(window, lexical_path.title(), lexical_path.extension()); - if (file_or_error.is_error()) { - GUI::MessageBox::show(window, String::formatted("Couldn't save file: {}.", file_or_error.error()), "Saving backtrace failed", GUI::MessageBox::Type::Error); + if (file_or_error.is_error()) return; - } auto file = file_or_error.value(); - file->write(full_backtrace.to_string()); + if (!file->write(full_backtrace.to_string())) + GUI::MessageBox::show(window, String::formatted("Couldn't save file: {}.", file_or_error.error()), "Saving backtrace failed", GUI::MessageBox::Type::Error); }; (void)Threading::BackgroundAction<ThreadBacktracesAndCpuRegisters>::construct( |