add exception catch-all in main
Catch all derived exceptions that may be thrown from the Updater.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I7ab1e74fc1378a3e8f73eae40295e42ef7a2833a
diff --git a/tools/main.cpp b/tools/main.cpp
index 640016a..5868d11 100644
--- a/tools/main.cpp
+++ b/tools/main.cpp
@@ -27,6 +27,7 @@
#include <algorithm>
#include <cstdio>
+#include <exception>
#include <iostream>
#include <ipmiblob/blob_handler.hpp>
#include <ipmiblob/ipmi_handler.hpp>
@@ -182,6 +183,12 @@
std::fprintf(stderr, "Exception received: %s\n", e.what());
return -1;
}
+ catch (const std::exception& e)
+ {
+ std::fprintf(stderr, "Unexpected exception received: %s\n",
+ e.what());
+ return -1;
+ }
}
return 0;