-
Notifications
You must be signed in to change notification settings - Fork 36
fix(exception-handling): Fix handling of network and other non-status-code errors when polling for datafile #287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(exception-handling): Fix handling of network and other non-status-code errors when polling for datafile #287
Conversation
076a62e
to
9918eba
Compare
…-code errors when polling for datafile
9918eba
to
e5eead0
Compare
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. |
@benweissmann thank you for submitting this change and signing our CLA. I will review this as soon as possible and get a release out. |
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.
Changes look good. Thank you for making the change and being so comprehensive.
Will merge after figuring out CI issues.
Tests succeeded here: https://travis-ci.org/github/optimizely/python-sdk/builds/708071108 Merging change. |
…-code errors when polling for datafile (#287)
@benweissmann just released updated SDK 3.5.2 with your change. |
Thank you! |
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_status
just 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;
zsh
requires quoting around.[test]
.Test plan