mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:17:44 +00:00
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.
This commit is contained in:
parent
ad8c6d858e
commit
c741db967c
1 changed files with 3 additions and 4 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue