]> granicus.if.org Git - graphviz/commitdiff
Add error message when either graph can't be loaded or contains backgrounds
authorerg <devnull@localhost>
Mon, 14 Jun 2010 16:55:24 +0000 (16:55 +0000)
committererg <devnull@localhost>
Mon, 14 Jun 2010 16:55:24 +0000 (16:55 +0000)
which we don't handle yet.

cmd/tools/gvpack.c

index 4c45374df2cecab5161a5f0a0e5c650c20885479..fae65a3d789ddfe9228a3eccf97f2ebc96c2c9f9 100644 (file)
@@ -300,8 +300,17 @@ static void init_graph(Agraph_t * g, boolean fill, GVC_t* gvc)
     }
     Ndim = GD_ndim(g) = 2;
     init_node_edge(g);
-    if (fill && init_nop(g, 0)) {
-       exit(1);
+    if (fill) {
+       int ret = init_nop(g,0);
+       if (ret) {
+           if (ret < 0)
+               fprintf(stderr, "Error loading layout info from graph %s\n",
+                   g->name);
+           else if (ret > 0)
+               fprintf(stderr, "gvpack does not support backgrounds as found in graph %s\n",
+                   g->name);
+           exit(1);
+       }
     }
 }