mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:27:43 +00:00
HexEditor: Propagate errors when using "Save"
This commit is contained in:
parent
2bba743c24
commit
a2dca2b762
5 changed files with 13 additions and 13 deletions
|
@ -132,8 +132,8 @@ HexEditorWidget::HexEditorWidget()
|
|||
if (m_path.is_empty())
|
||||
return m_save_as_action->activate();
|
||||
|
||||
if (!m_editor->save()) {
|
||||
GUI::MessageBox::show(window(), "Unable to save file.\n"sv, "Error"sv, GUI::MessageBox::Type::Error);
|
||||
if (auto result = m_editor->save(); result.is_error()) {
|
||||
GUI::MessageBox::show(window(), DeprecatedString::formatted("Unable to save file: {}\n"sv, result.error()), "Error"sv, GUI::MessageBox::Type::Error);
|
||||
} else {
|
||||
window()->set_modified(false);
|
||||
m_editor->update();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue