Raise Error when HTTPReader get 404 Response (#160)#569
Closed
diegoaichele wants to merge 6 commits intometa-pytorch:mainfrom
Closed
Raise Error when HTTPReader get 404 Response (#160)#569diegoaichele wants to merge 6 commits intometa-pytorch:mainfrom
diegoaichele wants to merge 6 commits intometa-pytorch:mainfrom
Conversation
- Add line of requests raise_for_status() will only allow 200 accepted requests
msaroufim
approved these changes
Jul 4, 2022
Contributor
VitalyFedyunin
left a comment
There was a problem hiding this comment.
Can you please add a test to https://github.com/pytorch/data/blob/main/test/test_remote_io.py#L60 which tries to load an unexisting url?
shorten the error message ([:54]), but the important thing is that the 404 response comes out
Contributor
Author
|
@VitalyFedyunin |
test/test_remote_io.py
Outdated
| # Error Test: test if the Http Reader raises an error when the url is invalid | ||
| error_url = "https://github.com/pytorch/data/this/url/dont/exist" | ||
| http_error_dp = HttpReader(IterableWrapper([error_url]), timeout=timeout) | ||
| with self.assertRaises(Exception) as e: |
Contributor
There was a problem hiding this comment.
Please use assertRaisesRegex it will reduce lines 91-92 to simple check.
VitalyFedyunin
approved these changes
Jul 20, 2022
NivekT
approved these changes
Jul 20, 2022
Contributor
|
@NivekT has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
|
@NivekT has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
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.
Fixes #160
Changes
Comments