win32 paths need some conversion
[mussa.git] / qui / mussagl.cpp
index bc6260f42813ac2df668728bad966642d2548768..919c3293b8d8fcb7d62b933d66cb394ce42b0c84 100644 (file)
@@ -6,6 +6,7 @@ using namespace boost::filesystem;
 
 #include "qui/MussaWindow.hpp"
 #include "alg/parse_options.hpp"
+#include "mussa_exceptions.hpp"
 
 int main(int argc, char **argv)
 {
@@ -25,11 +26,21 @@ int main(int argc, char **argv)
     return 1;
   }
 
-  if (opts.useGUI) { 
-    MussaWindow win(opts.analysis);
-    win.show();
-    app.exec();
+  try {
+    if (opts.useGUI) { 
+      MussaWindow win(opts.analysis);
+      win.show();
+      app.exec();
+    }
+    return 0;
+  } catch (mussa_error e) {
+    qFatal(e.what());
+  } catch (boost::filesystem::filesystem_error e) {
+    qFatal(e.what());
+  } catch (std::runtime_error e) {
+    qFatal(e.what());
+  } catch (...) {
+    qFatal("unrecognized exception");
   }
-
-  return 0;
+  return 1;
 }