Built in catching errors

Errors thrown as const char* will be caught and outputted to a message
box on windows or fprintf on other systems.