From dbceb169f7a11d7a0e1fcdffdb01bcdd24e86d3f Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 10 Mar 2017 09:27:40 -0500 Subject: [PATCH] Only last-chance catch exceptions if we are running not in developer mode --- apps/OpenSpace/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 16b05b6ed4..b4ca4eece6 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -36,6 +36,8 @@ #include #endif // OPENVR_SUPPORT +#define DEVELOPER_MODE + namespace { const char* _loggerCat = "main"; @@ -395,7 +397,13 @@ int main_main(int argc, char** argv) { } // namespace int main(int argc, char** argv) { + // If we are working as a developer, we don't want to catch the exceptions in order to + // find the locations where the exceptions are raised. + // If we are not in developer mode, we want to catch and at least log the error before + // dying +#ifdef DEVELOPER_MODE return main_main(argc, argv); +#else // We wrap the actual main function in a try catch block so that we can get and print // some additional information in case an exception is raised try { @@ -422,4 +430,5 @@ int main(int argc, char** argv) { LogMgr.flushLogs(); return EXIT_FAILURE; } +#endif // DEVELOPER_MODE }