fix(exception-handling): Fix handling of network and other non-status-code errors when polling for datafile#287
Merged
aliabbasrizvi merged 3 commits intooptimizely:masterfrom Jul 14, 2020
Conversation
076a62e to
9918eba
Compare
…-code errors when polling for datafile
9918eba to
e5eead0
Compare
Contributor
Author
|
It looks like CI is failing because of a missing credential -- maybe because I'm an outside contributor? The tests do pass on my machine. |
Contributor
|
@benweissmann thank you for submitting this change and signing our CLA. I will review this as soon as possible and get a release out. |
aliabbasrizvi
approved these changes
Jul 13, 2020
Contributor
aliabbasrizvi
left a comment
There was a problem hiding this comment.
Changes look good. Thank you for making the change and being so comprehensive.
Will merge after figuring out CI issues.
Contributor
|
Tests succeeded here: https://travis-ci.org/github/optimizely/python-sdk/builds/708071108 Merging change. |
aliabbasrizvi
pushed a commit
that referenced
this pull request
Jul 14, 2020
…-code errors when polling for datafile (#287)
Contributor
|
@benweissmann just released updated SDK 3.5.2 with your change. |
Contributor
Author
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fix(exception-handling): Catch errors when requesting datafile #285 was an incomplete fix; as per the docs, timeouts and other network errors throw on the call to
.get(), not on the call to.raise_for_status()(raise_for_statusjust checks for a non-2xx HTTP return code; it doesn't handle other kinds of errors)This adds additional error handling around calls to
requests.get.Also made a small tweak to the README;
zshrequires quoting around.[test].Test plan