Skip to content

[api] option to unmute ApiError exceptions#76

Merged
yannmh merged 2 commits intomasterfrom
yann/silence-exceptions
Aug 20, 2015
Merged

[api] option to unmute ApiError exceptions#76
yannmh merged 2 commits intomasterfrom
yann/silence-exceptions

Conversation

@yannmh
Copy link
Copy Markdown

@yannmh yannmh commented Aug 6, 2015

Datadog API HTTP client raises ApiError (400, 403 or 404 status codes)
and HTTPError (others) exceptions for bad requests.
BUT, we are, by default, muting any exceptions before they escape from
the library. This makes difficult to catch errors and interact with the
API.

These changes introduces a mute option settable from initialize
method, to select the desired behavior.

Fix #74

@yannmh yannmh self-assigned this Aug 6, 2015
Datadog API HTTP client raises ApiError (400, 403 or 404 status codes)
and HTTPError (others) exceptions for bad requests.
BUT, we are, by default, muting any exceptions before they escape from
the library. This makes difficult to catch errors and interact with the
API.

These changes introduces a `mute` option settable from `initialize`
method, to select the desired behavior.

Fix #74
@yannmh yannmh force-pushed the yann/silence-exceptions branch from c7dca26 to f476bab Compare August 6, 2015 22:32
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, but could you rename MockReponse --> MockResponse :)

@olivielpeau
Copy link
Copy Markdown
Member

LGTM, love the tests!

Just a small nitpick on a name, apart from that :shipit:

Fix typo in API unit tests: replace `MockReponse` with `MockResponse`.
@yannmh
Copy link
Copy Markdown
Author

yannmh commented Aug 20, 2015

Thanks @olivielpeau. Merging ⚓

yannmh pushed a commit that referenced this pull request Aug 20, 2015
[api] option to unmute ApiError exceptions
@yannmh yannmh merged commit 08cfee7 into master Aug 20, 2015
@yannmh yannmh deleted the yann/silence-exceptions branch August 20, 2015 15:42
@yannmh yannmh mentioned this pull request Aug 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants