Catch exceptions during photo metadata reload

This commit is contained in:
voussoir 2017-03-17 14:02:33 -07:00
parent df32b0c11d
commit 3a01285f09

View file

@ -709,7 +709,12 @@ def post_photo_refresh_metadata(photoid):
Refresh the file metadata. Refresh the file metadata.
''' '''
photo = P_photo(photoid, response_type='json') photo = P_photo(photoid, response_type='json')
photo.reload_metadata() try:
photo.reload_metadata()
except exceptions.EtiquetteException as e:
response = jsonify.exception(e)
response = jsonify.make_json_response(response, status=400)
flask.abort(response)
return jsonify.make_json_response({}) return jsonify.make_json_response({})