From 428f8872d15aff319602697f16ffb51868c86c12 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 2 Apr 2019 17:52:19 -0700 Subject: file basic editing; several cleanups - use logging when appropriate - refactor out editgroup form fetching code - handle "editgroup doesn't exist" error (and display) --- python/fatcat_web/routes.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'python/fatcat_web/routes.py') diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index ed9abf0b..c4152188 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -22,6 +22,7 @@ def container_history(ident): entity = api.get_container(ident) history = api.get_container_history(ident) except ApiException as ae: + app.logger.info(ae) abort(ae.status) #print(history) return render_template('entity_history.html', @@ -57,7 +58,7 @@ def container_view(ident): stats = get_elastic_container_stats(entity.issnl) except Exception as e: stats = None - print(e) + app.logger.error(e) else: stats = None @@ -397,7 +398,7 @@ def stats_page(): stats = get_elastic_entity_stats() stats.update(get_changelog_stats()) except Exception as ae: - print(ae) + app.logger.error(e) abort(503) return render_template('stats.html', stats=stats) @@ -410,7 +411,7 @@ def stats_json(): stats = get_elastic_entity_stats() stats.update(get_changelog_stats()) except Exception as ae: - print(ae) + app.logger.error(e) abort(503) return jsonify(stats) @@ -420,7 +421,7 @@ def container_issnl_stats(issnl): try: stats = get_elastic_container_stats(issnl) except Exception as ae: - print(ae) + app.logger.error(e) abort(503) return jsonify(stats) -- cgit v1.2.3