From a2ca0bf3b112cee911ad44c63956d13b9c8b1650 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 14 Apr 2014 14:41:27 -0400 Subject: [PATCH] Catch exceptions and show an error dialog to the user --- osx/boe.main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/osx/boe.main.cpp b/osx/boe.main.cpp index 0649b930..d1de465e 100644 --- a/osx/boe.main.cpp +++ b/osx/boe.main.cpp @@ -158,6 +158,7 @@ bool mac_is_intel; int main(void) { + try{ //data_store = (piles_of_stuff_dumping_type *) NewPtr(sizeof(piles_of_stuff_dumping_type)); init_menubar(); // Do this first of all because otherwise a default File and Window menu will be seen Initialize(); @@ -209,6 +210,16 @@ int main(void) close_program(); return 0; + } catch(std::exception& x) { + giveError(x.what()); + throw; + } catch(std::string& x) { + giveError(x); + throw; + } catch(...) { + giveError("An unknown error occurred!"); + throw; + } } void check_for_intel(){