Skip to content

Commit 3b0c40a

Browse files
author
Aaron Godfrey
committed
Changing wording of exception to make it clear where the error comes
from.
1 parent 767cd6b commit 3b0c40a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: doctor/flask.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def handle_http(schema, handler, args, kwargs, logic, request_schema,
149149
for cls in allowed_exceptions):
150150
raise
151151
logging.exception(unicode(e))
152-
raise HTTP500Exception('Uncaught doctor errors')
152+
raise HTTP500Exception('Uncaught error in logic function')
153153

154154

155155
class FlaskResourceSchema(ResourceSchema):

Diff for: test/test_flask.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def test_handle_unexpected_error(self, mock_current_app):
229229
mock_current_app.config = {'DEBUG': False}
230230
self.mock_logic_exception(TypeError('bad type'))
231231
with self.assertRaisesRegexp(
232-
HTTP500Exception, r'Uncaught doctor error'):
232+
HTTP500Exception, r'Uncaught error in logic function'):
233233
self.call_handle_http()
234234

235235
# When DEBUG is True, it should reraise the original exception
@@ -254,5 +254,5 @@ class ExceptionalException(Exception):
254254
# but other exceptions should still be caught
255255
self.mock_logic_exception(TypeError('bad type'))
256256
with self.assertRaisesRegexp(
257-
HTTP500Exception, r'Uncaught doctor error'):
257+
HTTP500Exception, r'Uncaught error in logic function'):
258258
self.call_handle_http()

0 commit comments

Comments
 (0)