1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:18:12 +00:00

PixelPaint: Include possible errno description in error messages

In the case where an error is created from an errno, calling
string_literal() will print nothing. Using Error's formatter
instead gives a more descriptive error message.
This commit is contained in:
Tim Ledbetter 2023-02-24 05:54:41 +00:00 committed by Jelle Raaijmakers
parent 3faf089be5
commit 5b84fafbca
2 changed files with 17 additions and 17 deletions

View file

@ -126,7 +126,7 @@ void MoveTool::on_mouseup(Layer* layer, MouseEvent& event)
if (m_scaling) {
auto scaled_layer_or_error = m_editor->active_layer()->scale(m_new_layer_rect, Gfx::Painter::ScalingMode::BilinearBlend);
if (scaled_layer_or_error.is_error())
GUI::MessageBox::show_error(m_editor->window(), MUST(String::formatted("Failed to resize layer: {}", scaled_layer_or_error.error().string_literal())));
GUI::MessageBox::show_error(m_editor->window(), MUST(String::formatted("Failed to resize layer: {}", scaled_layer_or_error.release_error())));
else
m_editor->layers_did_change();
}