]> gitweb.michael.orlitzky.com - libsvgtiny-pixbuf.git/commitdiff
io-svg.c: update libsvgtiny error descriptions.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 5 Aug 2023 21:59:45 +0000 (17:59 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 5 Aug 2023 21:59:45 +0000 (17:59 -0400)
The libsvgtiny README gives you some idea of what they mean.

io-svg.c

index b65d089f657d952144789608bcb0d3feba74e2bc..5f57689902e9d3830d799f0646f1b74c4425dfff 100644 (file)
--- a/io-svg.c
+++ b/io-svg.c
@@ -124,9 +124,9 @@ static diagram_t* svgtiny_diagram_from_buffer(char* buffer,
   diagram = svgtiny_create();
   if (!diagram) {
     g_set_error_literal(error,
-                        GDK_PIXBUF_ERROR,
-                        GDK_PIXBUF_ERROR_FAILED,
-                        "svgtiny_create() failed");
+                        G_FILE_ERROR,
+                        G_FILE_ERROR_NOMEM,
+                        "out of memory in svgtiny_create()");
     return NULL;
   }
 
@@ -145,19 +145,19 @@ static diagram_t* svgtiny_diagram_from_buffer(char* buffer,
       g_set_error_literal(error,
                           GDK_PIXBUF_ERROR,
                           GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
-                          "libdom error in svgtiny_parse()");
+                          "invalid XML DOM in svgtiny_parse()");
       break;
     case svgtiny_NOT_SVG:
       g_set_error_literal(error,
                           GDK_PIXBUF_ERROR,
                           GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
-                          "encountered svgtiny_NOT_SVG in svgtiny_parse()");
+                          "missing <svg> element in svgtiny_parse()");
       break;
     case svgtiny_SVG_ERROR:
       g_set_error(error,
                   GDK_PIXBUF_ERROR,
                   GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
-                  "SVG error in svgtiny_parse() on line %i: %s",
+                  "SVG format error in svgtiny_parse() on line %i: %s",
                   diagram->error_line,
                   diagram->error_message);
       break;