Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
bug: Add ClientError handler to UnregisterCommand
Browse files Browse the repository at this point in the history
Closes: #1154
  • Loading branch information
jrconlin committed Mar 14, 2018
1 parent a98c045 commit 9b99c28
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions autopush/webpush_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,17 @@ def process(self,

message = Message(command.message_month,
boto_resource=self.db.resource)
# TODO: JSONResponseError not handled (no force_retry)
message.unregister_channel(command.uaid.hex, command.channel_id)
try:
message.unregister_channel(command.uaid.hex, command.channel_id)
except ClientError as ex: # pragma: nocover
# Since this operates in a separate thread than the tests,
# we can't mock out the unregister_channel call inside
# test_webpush_server, thus the # nocover.
log.error("Unregister failed",
channel_id=command.channel_id,
uaid_hash=hasher(command.uaid.hex),
exeption=ex)
return UnregisterErrorResponse(error_msg="Unregister failed")

# TODO: Clear out any existing tracked messages for this channel

Expand Down

0 comments on commit 9b99c28

Please sign in to comment.