Skip to content

Commit 46ba394

Browse files
committed
xr_3da: implement try-cath in main binary
1 parent 7c813fa commit 46ba394

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/xr_3da/entry_point.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,24 @@ int main(int argc, char *argv[])
101101

102102
free(commandLine);
103103
}
104-
catch (...)
104+
catch (const std::overflow_error& e)
105105
{
106106
_resetstkoflw();
107-
FATAL("stack overflow");
107+
FATAL_F("stack overflow: %s", e.what());
108+
}
109+
catch (const std::runtime_error& e)
110+
{
111+
FATAL_F("runtime error: %s", e.what());
112+
}
113+
catch (const std::exception& e)
114+
{
115+
FATAL_F("exception: %s", e.what());
108116
}
117+
catch (...)
118+
{
119+
// this executes if f() throws std::string or int or any other unrelated type
120+
}
121+
109122
return result;
110123
}
111124
#endif

0 commit comments

Comments
 (0)