mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-11-15 18:02:49 +00:00
pages for handling 404 and 500 errors (#61)
This commit is contained in:
parent
0db4a35c88
commit
0d227ebbc2
|
@ -488,6 +488,27 @@ def page_help():
|
||||||
templateData = {"ui_settings": read_ui_settings()}
|
templateData = {"ui_settings": read_ui_settings()}
|
||||||
return render_template('help.html', **templateData)
|
return render_template('help.html', **templateData)
|
||||||
|
|
||||||
|
## Error handlers
|
||||||
|
@app.errorhandler(404)
|
||||||
|
def not_found_error(error):
|
||||||
|
templateData = {
|
||||||
|
"title": "myNode 404",
|
||||||
|
"header_text": "Page not found",
|
||||||
|
"subheader_text": "Click on the mynode logo reach the home page",
|
||||||
|
"ui_settings": read_ui_settings()
|
||||||
|
}
|
||||||
|
return render_template('state.html', **templateData), 404
|
||||||
|
|
||||||
|
@app.errorhandler(500)
|
||||||
|
def internal_error(error):
|
||||||
|
templateData = {
|
||||||
|
"title": "myNode 500",
|
||||||
|
"header_text": "Internal server error",
|
||||||
|
"subheader_text": "If you were manually upgrading myNode, redo it.",
|
||||||
|
"ui_settings": read_ui_settings()
|
||||||
|
}
|
||||||
|
return render_template('state.html', **templateData), 500
|
||||||
|
|
||||||
# Disable browser caching
|
# Disable browser caching
|
||||||
@app.after_request
|
@app.after_request
|
||||||
def set_response_headers(response):
|
def set_response_headers(response):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user