bucket.go: check the bucket works before returning it.
Fixes
@@ -133,5 +133,12 @@ func setUpBucket(
b)
}
+ // Ensure the bucket works, catching problems early.
+ _, err = b.ListObjects(ctx, &gcs.ListObjectsRequest{MaxResults: 1})
+ if err != nil {
+ err = fmt.Errorf("checking bucket works: %v", err)
+ return
+ }
+
return
}
