Slightly nicer error handling.
authorCarl Hetherington <cth@carlh.net>
Thu, 8 Nov 2018 21:57:56 +0000 (21:57 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 8 Nov 2018 21:57:56 +0000 (21:57 +0000)
tools/dcpthumb.cc

index 73f70f2da007b001d02e33d49570d7126d8140ff..7d90c2ef72e69a7695ba706083918da7956eb281 100644 (file)
@@ -78,6 +78,12 @@ main (int argc, char* argv[])
                exit (EXIT_FAILURE);
        }
 
-       cout << dcp::Certificate(dcp::file_to_string(argv[optind])).thumbprint() << "\n";
+       try {
+               cout << dcp::Certificate(dcp::file_to_string(argv[optind])).thumbprint() << "\n";
+       } catch (boost::filesystem::filesystem_error& e) {
+               cerr << e.what() << "\n";
+               return -1;
+       }
+
        return 0;
 }