From 44376290b3bdea1c0a40fa070e9a2740f10f1e62 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 9 Oct 2011 22:52:00 +0000 Subject: Log fatal exceptions in main helper using BOX_FATAL instead of printf, to ensure they get logged in all the right places. --- lib/common/MainHelper.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/common') diff --git a/lib/common/MainHelper.h b/lib/common/MainHelper.h index d91bc2f9..3c973624 100644 --- a/lib/common/MainHelper.h +++ b/lib/common/MainHelper.h @@ -13,6 +13,7 @@ #include #include "BoxException.h" +#include "Logging.h" #define MAINHELPER_START \ if(argc == 2 && ::strcmp(argv[1], "--version") == 0) \ @@ -21,15 +22,13 @@ MEMLEAKFINDER_START \ try { #define MAINHELPER_END \ - } catch(BoxException &e) { \ - printf("Exception: %s (%d/%d)\n", e.what(), e.GetType(), e.GetSubType()); \ - return 1; \ } catch(std::exception &e) { \ - printf("Exception: %s\n", e.what()); \ - return 1; \ + BOX_FATAL(e.what()); \ + return 1; \ } catch(...) { \ - printf("Exception: \n"); \ - return 1; } + BOX_FATAL("UNKNOWN"); \ + return 1; \ + } #ifdef BOX_MEMORY_LEAK_TESTING #define MAINHELPER_SETUP_MEMORY_LEAK_EXIT_REPORT(file, marker) \ -- cgit v1.2.3