Create custom error handling for debugging.