Simple helper function for better handling of the uncaughtException event