Skip to content

Commit

Permalink
lib/cairo: Add Cairo status to error message (#2378)
Browse files Browse the repository at this point in the history
The original message about failing to initialize a Cairo surface does not include any reason. This adds size and status from Cairo.
  • Loading branch information
wenzeslaus committed May 18, 2022
1 parent 62e17c3 commit 30cca6b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/cairodriver/graph.c
Expand Up @@ -373,7 +373,10 @@ static void init_cairo(void)
}

if (cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS)
G_fatal_error(_("Failed to initialize Cairo surface"));
G_fatal_error(_("Failed to initialize Cairo surface"
" (width: %d, height: %d): %s"),
ca.width, ca.height,
cairo_status_to_string(cairo_surface_status(surface)));

cairo = cairo_create(surface);
}
Expand Down

0 comments on commit 30cca6b

Please sign in to comment.