500 error handling
Handle internal errors to prevent stack trace leakage