Skip to content

Commit c741db9

Browse files
LucasCholletawesomekling
authored andcommitted
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.
1 parent ad8c6d8 commit c741db9

File tree

1 file changed

+3
-4
lines changed
  • Userland/Applications/CrashReporter

1 file changed

+3
-4
lines changed

Userland/Applications/CrashReporter/main.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
284284

285285
LexicalPath lexical_path(String::formatted("{}_{}_backtrace.txt", pid, app_name));
286286
auto file_or_error = FileSystemAccessClient::Client::the().try_save_file(window, lexical_path.title(), lexical_path.extension());
287-
if (file_or_error.is_error()) {
288-
GUI::MessageBox::show(window, String::formatted("Couldn't save file: {}.", file_or_error.error()), "Saving backtrace failed", GUI::MessageBox::Type::Error);
287+
if (file_or_error.is_error())
289288
return;
290-
}
291289

292290
auto file = file_or_error.value();
293-
file->write(full_backtrace.to_string());
291+
if (!file->write(full_backtrace.to_string()))
292+
GUI::MessageBox::show(window, String::formatted("Couldn't save file: {}.", file_or_error.error()), "Saving backtrace failed", GUI::MessageBox::Type::Error);
294293
};
295294

296295
(void)Threading::BackgroundAction<ThreadBacktracesAndCpuRegisters>::construct(

0 commit comments

Comments
 (0)