forked from orbit-oss/flask
show nice message when registering error handler for unknown code
clean up error handler docs closes #1837
This commit is contained in:
parent
9049755e3f
commit
859d9a9d5c
3 changed files with 79 additions and 54 deletions
|
|
@ -870,6 +870,13 @@ def test_error_handling(app, client):
|
|||
assert b'forbidden' == rv.data
|
||||
|
||||
|
||||
def test_error_handler_unknown_code(app):
|
||||
with pytest.raises(KeyError) as exc_info:
|
||||
app.register_error_handler(999, lambda e: ('999', 999))
|
||||
|
||||
assert 'Use a subclass' in exc_info.value.args[0]
|
||||
|
||||
|
||||
def test_error_handling_processing(app, client):
|
||||
app.config['LOGGER_HANDLER_POLICY'] = 'never'
|
||||
app.testing = False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue