diff --git a/chalice/app.py b/chalice/app.py index a4a081ed0..657177777 100644 --- a/chalice/app.py +++ b/chalice/app.py @@ -668,12 +668,12 @@ def _get_view_function_response(self, view_function, function_args): status_code=e.STATUS_CODE) except Exception as e: headers = {} + self.log.error("Caught exception for %s", view_function, + exc_info=True) if self.debug: # If the user has turned on debug mode, - # we'll let the original exception propogate so + # we'll let the original exception propagate so # they get more information about what went wrong. - self.log.debug("Caught exception for %s", view_function, - exc_info=True) stack_trace = ''.join(traceback.format_exc()) body = stack_trace headers['Content-Type'] = 'text/plain'