Rename all caught exception variables to "exc", not "e".

This commit is contained in:
voussoir 2020-09-19 03:08:45 -07:00
parent 7f410f1da5
commit a7cc6d2383
2 changed files with 5 additions and 5 deletions

View file

@ -143,9 +143,9 @@ def normalize_author(authors, photodb, warning_bag=None):
try: try:
user = photodb.get_user(username=requested_author) user = photodb.get_user(username=requested_author)
except exceptions.NoSuchUser as e: except exceptions.NoSuchUser as exc:
if warning_bag: if warning_bag:
warning_bag.add(e.error_message) warning_bag.add(exc.error_message)
else: else:
raise raise
else: else:

View file

@ -16,12 +16,12 @@ def catch_etiquette_exception(function):
def wrapped(*args, **kwargs): def wrapped(*args, **kwargs):
try: try:
return function(*args, **kwargs) return function(*args, **kwargs)
except etiquette.exceptions.EtiquetteException as e: except etiquette.exceptions.EtiquetteException as exc:
if isinstance(e, etiquette.exceptions.NoSuch): if isinstance(exc, etiquette.exceptions.NoSuch):
status = 404 status = 404
else: else:
status = 400 status = 400
response = etiquette.jsonify.exception(e) response = etiquette.jsonify.exception(exc)
response = jsonify.make_json_response(response, status=status) response = jsonify.make_json_response(response, status=status)
flask.abort(response) flask.abort(response)
return wrapped return wrapped