Skip to content

Conversation

@shubhangi-google
Copy link
Contributor

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

@shubhangi-google shubhangi-google requested a review from a team as a code owner September 8, 2025 12:02
@shubhangi-google shubhangi-google marked this pull request as draft September 8, 2025 12:07
@cpriti-os
Copy link

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return true here?

Copy link
Contributor Author

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it thanks

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.

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants