Skip to content

Commit

Permalink
catch exception on cdrhook failure
Browse files Browse the repository at this point in the history
  • Loading branch information
robkooper committed Apr 17, 2024
1 parent 34dc441 commit 00aa136
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.1.0] - 2024-04-16

### Added
- if cdrhook fails, push message to cdrhook.error

### Changed
- uploaded will now load cdr json and add cog_id, system and system_version.

Expand Down
7 changes: 6 additions & 1 deletion server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@ def hook():
if data.get("event") == "ping":
logging.debug("Received ping")
elif data.get("event") == "map.process":
process_map(data["payload"]["cog_id"], data["payload"]["cog_url"])
try:
process_map(data["payload"]["cog_id"], data["payload"]["cog_url"])
except:
logging.exception("Could not process hook")
data["x-cdr-signature-256"] = request.data, request.headers.get("x-cdr-signature-256")
send_message(data, "cdrhook.error")
else:
logging.debug("Unknown event: %s", data.get("event"))

Expand Down

0 comments on commit 00aa136

Please sign in to comment.