-
Notifications
You must be signed in to change notification settings - Fork 878
chore: Error handling when upload id I'd incorrect for Resumable upload #24234
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
base: main
Are you sure you want to change the base?
chore: Error handling when upload id I'd incorrect for Resumable upload #24234
Conversation
|
Please fix the title: looks like there are some typos |
| if response.status.to_i == 404 | ||
| logger.debug { sprintf("Failed to fetch upload session. Response: #{response.status.to_i} - #{response.body}") } | ||
| false | ||
| end |
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.
Return true here?
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 call to check the upload ID's status failed with a 404 error. That status code means the upload ID is not recognized by the server, so the process is stopping and returning false.
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.
Got it thanks
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.
Could you also add tests for success cases.
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.
success test cases were added and have been merged already here
Updated code to explicitly handle 404 (Not Found) responses, ensuring that operations correctly fail when an upload session ID is invalid.
Error handling done for code implemented in - #21896, #23376
Implementation linked with- googleapis/google-cloud-ruby#30882