-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patherror_manager.py
More file actions
34 lines (24 loc) · 1.41 KB
/
error_manager.py
File metadata and controls
34 lines (24 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from flask import render_template
def unauthorized(e):
return render_template('http-error.html',
error="401 - Unauthorized", error_description="You're unauthorized to perform this action.",
), 401
def forbidden(e):
return render_template('http-error.html',
error="403 - Forbidden", error_description="You're unauthorized to perform this action.",
), 403
def not_found(e):
return render_template('http-error.html',
error="404 - Page Not Found", error_description="Page not found.",
), 404
def internal_error(e):
return render_template('http-error.html',
error="500 - Internal Server Error", error_description="An error has occurred on our side, "
"we apologize for the inconvenience.",
), 500
def bad_request(e):
return render_template('http-error.html',
error="400 - Bad Request", error_description="The browser sent a request that the server"
" could not understand,"
" we apologize for the inconvenience.",
), 500