From 8b84e83b79de67996e61a3a830e8f395b68085e5 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 26 Nov 2018 17:35:09 -0800 Subject: pass-through more API errors --- python/fatcat_web/routes.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index 64d5931e..0bb7a230 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -278,13 +278,19 @@ def editgroup_view(ident): @app.route('/editor/', methods=['GET']) def editor_view(ident): - entity = api.get_editor(ident) + try: + entity = api.get_editor(ident) + except ApiException as ae: + abort(ae.status) return render_template('editor_view.html', editor=entity) @app.route('/editor//changelog', methods=['GET']) def editor_changelog(ident): - editor = api.get_editor(ident) - changelog_entries = api.get_editor_changelog(ident) + try: + editor = api.get_editor(ident) + changelog_entries = api.get_editor_changelog(ident) + except ApiException as ae: + abort(ae.status) return render_template('editor_changelog.html', editor=editor, changelog_entries=changelog_entries) @@ -306,7 +312,10 @@ def changelog_entry_view(index): @app.route('/stats', methods=['GET']) def stats_view(): - stats = api.get_stats() + try: + stats = api.get_stats() + except ApiException as ae: + abort(ae.status) return render_template('stats.html', stats=stats.extra) ### Search ################################################################## -- cgit v1.2.3