Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Add simple client for sending messages to the Go HTTP API. #1

Merged
merged 15 commits into from Jun 26, 2014

Conversation

hodgestar
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 965c097 on feature/issue-1-simple-sending-client into 8e48658 on develop.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling adc0ee6 on feature/issue-1-simple-sending-client into 8e48658 on develop.

@hodgestar
Copy link
Contributor Author

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()
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@hodgestar
Copy link
Contributor Author

Ready for re-review.

@imsickofmaps
Copy link
Contributor

I can't see anything else, looks good to me 👍

@hodgestar hodgestar merged commit 86f26e1 into develop Jun 26, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants