Gracefully handle most internal server errors, returning an error message instead