Skip to content
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

Handle download errors before saving files to disk #56

Merged
merged 1 commit into from Oct 3, 2019

Conversation

@lethosor
Copy link
Contributor

commented Oct 3, 2019

Parsing errors needs to be done before reading the response - if handled after, the error message itself is written to disk, and then the exception doesn't have the message returned from the API (e.g. 400s will just report voxel51.users.api.APIError: 400: Bad Request for URL) because the response body can only be read once. (_validate_response only reads the status code for successful requests, so downloading data that exists still works.)

Copy link
Contributor

left a comment

good catch

@lethosor lethosor merged commit bc48acb into develop Oct 3, 2019
@lethosor lethosor deleted the fix-download-error-handling branch Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.