1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

LibFileSystemAccessClient+CrashReporter: Introduce FSAC::File and use it

The new result returned just a file stream, which wasn't sufficient
enough for most applications because it didn't provide a filename.

This patch will make a new File object that has both a file stream and
a filename.
This commit is contained in:
Karol Kosek 2022-12-16 23:15:12 +01:00 committed by Sam Atkins
parent 247db3fdd0
commit 2cbe2dd3c0
3 changed files with 27 additions and 3 deletions

View file

@ -280,7 +280,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return;
}
auto file = file_or_error.release_value();
auto file = file_or_error.release_value().release_stream();
if (auto result = file->write(full_backtrace.to_byte_buffer()); result.is_error())
GUI::MessageBox::show(window, DeprecatedString::formatted("Couldn't save file: {}.", result.release_error()), "Saving backtrace failed"sv, GUI::MessageBox::Type::Error);
};