mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-08 04:20:14 -05:00
Only last-chance catch exceptions if we are running not in developer mode
This commit is contained in:
@@ -36,6 +36,8 @@
|
|||||||
#include <SGCTOpenVR.h>
|
#include <SGCTOpenVR.h>
|
||||||
#endif // OPENVR_SUPPORT
|
#endif // OPENVR_SUPPORT
|
||||||
|
|
||||||
|
#define DEVELOPER_MODE
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
const char* _loggerCat = "main";
|
const char* _loggerCat = "main";
|
||||||
@@ -395,7 +397,13 @@ int main_main(int argc, char** argv) {
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
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);
|
return main_main(argc, argv);
|
||||||
|
#else
|
||||||
// We wrap the actual main function in a try catch block so that we can get and print
|
// 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
|
// some additional information in case an exception is raised
|
||||||
try {
|
try {
|
||||||
@@ -422,4 +430,5 @@ int main(int argc, char** argv) {
|
|||||||
LogMgr.flushLogs();
|
LogMgr.flushLogs();
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
#endif // DEVELOPER_MODE
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user