Add simple client for sending messages to the Go HTTP API. #1
Conversation
…hat make API requests in case the TestSession is accidentally not used.
Ready for review. |
auth = (self.account_key, self.conversation_token) | ||
data = json.dumps(py_data) | ||
r = self.session.put(url, auth=auth, data=data, headers=headers) | ||
r.raise_for_status() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we just expecting Sentry to catch all these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure what the question is suggesting? Would it be preferred to have custom exception classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I guess not with your API as you should only get error codes for genuine errors so the consuming client should decide what to do with the raised exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requests seems to raise these all nicely as HTTPError
and I think that makes sense here.
Ready for re-review. |
I can't see anything else, looks good to me 👍 |
No description provided.