diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-04-02 17:52:19 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-04-02 17:52:21 -0700 |
commit | 428f8872d15aff319602697f16ffb51868c86c12 (patch) | |
tree | d7bc952458de2a12343b116126049db13077752a /python/fatcat_web/routes.py | |
parent | 7240dbce3300ff30999e3730ef9330d6ff93b06c (diff) | |
download | fatcat-428f8872d15aff319602697f16ffb51868c86c12.tar.gz fatcat-428f8872d15aff319602697f16ffb51868c86c12.zip |
file basic editing; several cleanups
- use logging when appropriate
- refactor out editgroup form fetching code
- handle "editgroup doesn't exist" error (and display)
Diffstat (limited to 'python/fatcat_web/routes.py')
-rw-r--r-- | python/fatcat_web/routes.py | 9 |
1 files changed, 5 insertions, 4 deletions
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) |