-
Notifications
You must be signed in to change notification settings - Fork 0
Using the Crash Handler
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.