Skip to content

Commit

Permalink
lib/cairo: Add Cairo status to error message (OSGeo#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 authored and ninsbl committed Feb 17, 2023
1 parent 32ca644 commit ad6e8b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/cairodriver/graph.c
Original file line number Diff line number Diff line change
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 ad6e8b4

Please sign in to comment.