You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SlowCuber17 edited this page Sep 21, 2018
·
3 revisions
This system will work similar to the JavaVM's exception handler.
At the top of your header/code file, include the following code:
#include "ExceptionInclude.cpp"
This will include any possible exceptions that you can then call, along with the CrashHandler that will handle exceptions that are thrown by crashing the game and logging the error that came up.
Throughout your code, if there's something that could result in an exception, use a try/catch block. If you catch an error, use the following code:
CrashHandler c = new CrashHandler(/*ExceptionTemplate*& e*/);
c.displayErrorMsg();
The CrashHandler will then log the specific error to the command terminal using the Logger if that error is ever thrown. It will automatically exit out of the game as well.