Skip to content

Commit

Permalink
send handled file creation and git errors to sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
fostermh committed Jul 24, 2024
1 parent 9684b48 commit b4896f9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cioos-records-update/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ def recordUpdate():

# returned value doesn't do anything
return jsonify(message=url)
except Exception:
except Exception as err:
print(traceback.format_exc())
sentry_sdk.capture_exception(err)
return make_response(jsonify(error="Error creating xml"), 500)


Expand Down Expand Up @@ -223,8 +224,9 @@ def recordToCFF():
record_type=recordFromFB.get('metadataScope')
)
return jsonify(message={"record": cff})
except Exception:
except Exception as err:
print(traceback.format_exc())
sentry_sdk.capture_exception(err)
return make_response(jsonify(error="Error creating cff"), 500)


Expand All @@ -241,8 +243,9 @@ def recordToERDDAP():
output='xml'
)
return jsonify(message={"xml": erddap_xml})
except Exception:
except Exception as err:
print(traceback.format_exc())
sentry_sdk.capture_exception(err)
return make_response(jsonify(error="Error creating erddap snippet"), 500)

@app.errorhandler(404)
Expand Down

0 comments on commit b4896f9

Please sign in to comment.