changeset 113:27e628852401

Add some error checking.
author Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no>
date Tue, 03 May 2016 02:23:14 +0200
parents 3951f6d27219
children d4e337567960
files Apps/updateDeDupe.cpp
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Apps/updateDeDupe.cpp	Tue May 03 02:20:07 2016 +0200
+++ b/Apps/updateDeDupe.cpp	Tue May 03 02:23:14 2016 +0200
@@ -1,5 +1,3 @@
-
-
 #include "DataController.hpp"
 
 #include "Exception/Exception.hpp"
@@ -9,7 +7,9 @@
 #include <boost/foreach.hpp>
 #include <boost/archive/detail/utf8_codecvt_facet.hpp>
 #include <locale>
+#include <stdexcept>
 #include <boost/archive/add_facet.hpp>
+
 //#include <codecvt>
 
 int main(int argc, char *argv[]) {
@@ -33,7 +33,13 @@
 
   try {
     if (paths.empty()) {
-      DataController dc(false);
+      try {
+	DataController dc(false);
+      }
+      catch (std::runtime_error &e) {
+	std::cerr << "Unrecoverable error: " << e.what() << std::endl;
+	exit(1);
+      }
     }
     else {
       foreach(const QString& path, paths) {