diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2020-07-28 17:05:05 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2020-07-28 17:29:44 -0700 |
commit | aa044a4a1ea1b423d46ade63d6a66dcf62bd80b5 (patch) | |
tree | 860e94cb0fb17a87d1d1425465b699dc2d22a546 /python/fatcat_web/routes.py | |
parent | ab80084f1cd90faf5e069edc4203668c81e75d63 (diff) | |
download | fatcat-aa044a4a1ea1b423d46ade63d6a66dcf62bd80b5.tar.gz fatcat-aa044a4a1ea1b423d46ade63d6a66dcf62bd80b5.zip |
convert some API errors from abort() to raise
Diffstat (limited to 'python/fatcat_web/routes.py')
-rw-r--r-- | python/fatcat_web/routes.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index a6634292..02e7b1d3 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -138,7 +138,7 @@ def generic_lookup_view(entity_type, lookup_template, extid_types, lookup_lambda ae.status) else: app.log.info(ae) - abort(ae.status) + raise ae return redirect('/{}/{}'.format(entity_type, resp.ident)) @app.route('/container/lookup', methods=['GET']) @@ -512,7 +512,7 @@ def editgroup_create_annotation(ident): user_api.create_editgroup_annotation(eg.editgroup_id, ega) except ApiException as ae: app.log.info(ae) - abort(ae.status) + raise ae return redirect('/editgroup/{}'.format(ident)) @app.route('/editgroup/<ident>/accept', methods=['POST']) @@ -770,7 +770,7 @@ def container_issnl_stats(issnl): try: container = api.lookup_container(issnl=issnl) except ApiException as ae: - abort(ae.status) + raise ae try: stats = get_elastic_container_stats(container.ident, issnl=container.issnl) except Exception as ae: @@ -826,7 +826,7 @@ def release_bibtex(ident): try: entity = api.get_release(ident) except ApiException as ae: - abort(ae.status) + raise ae csl = release_to_csl(entity) bibtex = citeproc_csl(csl, 'bibtex') return Response(bibtex, mimetype="text/plain") @@ -843,7 +843,7 @@ def release_citeproc(ident): try: entity = api.get_release(ident) except ApiException as ae: - abort(ae.status) + raise ae csl = release_to_csl(entity) cite = citeproc_csl(csl, style, is_html) if is_html: @@ -901,7 +901,7 @@ def change_username(): editor = user_api.update_editor(editor.editor_id, editor) except ApiException as ae: app.log.info(ae) - abort(ae.status) + raise ae # update our session session['editor'] = editor.to_dict() load_user(editor.editor_id) @@ -938,7 +938,7 @@ def create_auth_token(): duration_seconds=duration_seconds) except ApiException as ae: app.log.info(ae) - abort(ae.status) + raise ae return render_template('auth_token.html', auth_token=resp.token) @app.route('/auth/logout') |