Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(board): improve gnes board 500 message
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Aug 2, 2019
1 parent 888aac8 commit fc5026d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gnes/composer/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ def _create_flask_app(self):
args = set_composer_parser().parse_args([])
default_html = YamlComposer(args).build_all()['html']

@app.errorhandler(500)
def exception_handler(error):
self.logger.error('unhandled error, i better quit and restart!')
return '<h1>500 Internal Error</h1> ' \
'While we are fixing the issue, do you know you can deploy GNES board locally on your machine? ' \
'Simply run <pre>docker run -d -p 0.0.0.0:80:8080/tcp gnes/gnes compose --flask</pre>', 500

@app.route('/', methods=['GET'])
def _get_homepage():
return default_html
Expand Down

0 comments on commit fc5026d

Please sign in to comment.