This fixes the problem that destructors aren't called during
stack-unwinding, if the exception in question is never caught,
which might in the worst-case prevent the wiping of private keys.
#include <iostream>
#include <fstream>
#include <streambuf>
+#include <stdexcept>
#include "db/database.h"
#include "db/mysql.h"
extern std::string serialPath;
-int main( int argc, const char* argv[] ) {
+int main( int argc, const char* argv[] ) try {
( void ) argc;
( void ) argv;
}
return -1;
+
+} catch(std::exception& e) {
+ std::cerr << "Fatal Error: " << e.what() << "!\n";
+ return -1;
+} catch(...) {
+ std::cerr << "Fatal Error: Unknown Exception!\n";
+ return -1;
}