Skip to content

Commit

Permalink
fix(logging): Correctly log the error about wrong channel response
Browse files Browse the repository at this point in the history
  • Loading branch information
koriaf committed Aug 3, 2020
1 parent 088ad01 commit cc7de14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion intergov/use_cases/request_channel_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ def subscribe_by_jurisdiction(self, callback_url, country, secret=''):
endpoint = self.CHANNEL_API_SUBSCRIBE_BY_JURISDICTION_ENDPOINT
response = self.post(endpoint, data=params)
if not response.status_code == 202:
raise SubscriptionFailure("Channel returned bad response, %r" % response.content)
logger.error(
"Non-202 response from a channel %s, %s", endpoint, str(response.content)
)
raise SubscriptionFailure("Non-202 response from a channel")

def get(self, endpoint):
url = self.get_url(endpoint)
Expand Down

0 comments on commit cc7de14

Please sign in to comment.