-
Notifications
You must be signed in to change notification settings - Fork 250
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
Requests library spec fidelity #746
Merged
reyang
merged 11 commits into
census-instrumentation:master
from
victoraugustolls:feature/requests-specs
Aug 6, 2019
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b24abd9
Added util for mapping http status code to grpc status code
victoraugustolls 73ba2fe
Updated requests integration to follow specs
victoraugustolls e1d8152
Updated changelogs
victoraugustolls 3c6882c
Merge branch 'master' into feature/requests-specs
victoraugustolls 7e2c3e3
Added common exception status
victoraugustolls 524dd23
Simplified http status code to status mapping
victoraugustolls d5ed389
Now using exceptions mappings
victoraugustolls b687467
Removed DNS_RESOLUTION_FAILED mapping
victoraugustolls d62efcc
Fixed exceptions status tests
victoraugustolls 09a060e
Merge branch 'master' into feature/requests-specs
victoraugustolls 2823238
Merge branch 'master' into feature/requests-specs
victoraugustolls File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
@reyang Isn't this
except
clause and the ones following going to eat the raised exception and returnsNone
in case of anyrequests
error? Unless I'm missing something this change is going to break many things.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.
Yes, but wont
requests
returnNone
in case it raises anException
? If so, the returned value is the sameThere 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.
Raising an exception should not "return" at all.
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.
What can be changed, and is a good idea actually, is to threat the
Exception
and raise it again, and let the user do whatever it wants. That's what you meant?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.
This should be fixed by adding a
raise
statement in everyexcept
block.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.
The main goal here is to keep this hook transparent and keep 1:1 interface as
requests
(Exceptions are part of that interface).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.
So you agreed with this, right? Just to be clear. If so, I do agree with you and I will open a PR to change this.
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.
Yes 👍 !
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.
@isra17 You're right, we've missed this. It is a bug.