Skip to content

Commit

Permalink
xr_3da: implement try-cath in main binary
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Nov 6, 2018
1 parent 7c813fa commit 46ba394
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/xr_3da/entry_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,24 @@ int main(int argc, char *argv[])

free(commandLine);
}
catch (...)
catch (const std::overflow_error& e)
{
_resetstkoflw();
FATAL("stack overflow");
FATAL_F("stack overflow: %s", e.what());
}
catch (const std::runtime_error& e)
{
FATAL_F("runtime error: %s", e.what());
}
catch (const std::exception& e)
{
FATAL_F("exception: %s", e.what());
}
catch (...)
{
// this executes if f() throws std::string or int or any other unrelated type
}

return result;
}
#endif

0 comments on commit 46ba394

Please sign in to comment.