chiark / gitweb /
CLI: Handle plot fails-to-start situations more gracefully.
authorRoss Younger <onyx-commits@impropriety.org.uk>
Mon, 4 Feb 2013 07:56:16 +0000 (20:56 +1300)
committerRoss Younger <onyx-commits@impropriety.org.uk>
Mon, 4 Feb 2013 07:56:16 +0000 (20:56 +1300)
cli/climain.cpp

index c11fd94..6dec66d 100644 (file)
@@ -275,7 +275,13 @@ int main (int argc, char**argv)
        sink.set_plot(&plot);
        plot.set_prefs(prefs);
 
-       plot.start();
+       try {
+               plot.start();
+       } catch (BrotException e) {
+               // Usually means the pixels are too small for all known types.
+               std::cerr << "Plot failed to start: " << e.msg << std::endl;
+               return 4;
+       }
        plot.wait();
        if (!quiet)
                std::cerr << std::endl << "Complete!" << std::endl;