Skip to content

Commit

Permalink
Issue #994. Add a 413 handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Taylor committed Apr 23, 2016
1 parent 68a0558 commit 9f8f15f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webcompat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
401: 'Unauthorized. Please log in.',
403: 'Forbidden. Maybe that looking at private stuff?',
404: 'Not Found. Lost in Punk Cat Space',
413: 'The image is too big!',
429: 'Cool your jets! Please wait {0} seconds before making '
'another search.',
500: 'Internal Server Error'}
Expand Down Expand Up @@ -299,14 +300,13 @@ def cssfixme():
@app.errorhandler(401)
@app.errorhandler(403)
@app.errorhandler(404)
@app.errorhandler(413)
@app.errorhandler(500)
def custom_error_handler(err):
if api_call(request):
return api_message(err.code)
return render_template(
'error.html',
error_code=err.code,
error_message=ERROR_DICT[err.code]), err.code
return render_template('error.html', error_code=err.code,
error_message=ERROR_DICT[err.code]), err.code


def api_call(request):
Expand Down

0 comments on commit 9f8f15f

Please sign in to comment.