mirror of
https://github.com/LukeHagar/pypistats.dev.git
synced 2025-12-09 20:57:43 +00:00
initial commit
This commit is contained in:
28
pypistats/views/error.py
Normal file
28
pypistats/views/error.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""Error page handlers."""
|
||||
from flask import Blueprint
|
||||
|
||||
blueprint = Blueprint('error', __name__, template_folder='templates')
|
||||
|
||||
|
||||
@blueprint.app_errorhandler(400)
|
||||
def handle_400(err):
|
||||
"""Return 400."""
|
||||
return "400"
|
||||
|
||||
|
||||
@blueprint.app_errorhandler(401)
|
||||
def handle_401(err):
|
||||
"""Return 401."""
|
||||
return "401"
|
||||
|
||||
|
||||
@blueprint.app_errorhandler(404)
|
||||
def handle_404(err):
|
||||
"""Return 404."""
|
||||
return "404"
|
||||
|
||||
|
||||
@blueprint.app_errorhandler(500)
|
||||
def handle_500(err):
|
||||
"""Return 500."""
|
||||
return "500"
|
||||
Reference in New Issue
Block a user