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 error for gcs list blob #274

Merged
merged 2 commits into from
Aug 16, 2024
Merged

Conversation

mnazzaro
Copy link
Contributor

No description provided.

@mnazzaro mnazzaro requested a review from bdc34 May 17, 2024 15:15
return self.bucket.client.list_blobs(self.bucket, prefix=prefix) # type: ignore
try:
return self.bucket.client.list_blobs(self.bucket, prefix=prefix) # type: ignore
except:
Copy link
Contributor

Choose a reason for hiding this comment

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

This will hide too many errors. I'd much rather have the user see a 500 error than a response built with an incorrectly empty list from this.

Replace this except with something like

except Exception as inner_ex:
    raise RuntimeException(f"Could not get obj_store.list() for {bucket} {prefix}") from inner_ex

@bdc34 bdc34 merged commit b515966 into develop Aug 16, 2024
1 check passed
@bdc34 bdc34 deleted the ARXIVCE-1639-browse-traces-again branch August 16, 2024 15:40
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