Skip to content

Commit

Permalink
chore: refactor error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
haristhohir committed Jun 12, 2024
1 parent bfc0786 commit 86f9389
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gcs_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ func (g gcsManager) ListFiles(bucketName string) ([]string, error) {
it := g.client.Bucket(bucketName).Objects(g.ctx, nil)
for {
attrs, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
if err == iterator.Done {
break
}

return nil, fmt.Errorf("failed to list objects: %v", err)
}
files = append(files, attrs.Name)
Expand Down

0 comments on commit 86f9389

Please sign in to comment.