Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gcp/resources/cloud_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ func NewCloudFunctions() GcpResource {
r.Scope.ProjectID = cfg.ProjectID
client, err := functions.NewFunctionClient(context.Background())
if err != nil {
panic(fmt.Sprintf("failed to create Cloud Functions client: %v", err))
r.InitializationError = fmt.Errorf("failed to create Cloud Functions client: %w", err)
return
}
r.Client = client
}),
Expand Down
5 changes: 2 additions & 3 deletions gcp/resources/gcs_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ func NewGCSBuckets() GcpResource {
r.Scope.ProjectID = cfg.ProjectID
client, err := storage.NewClient(context.Background())
if err != nil {
// Panic is recovered by GcpResourceAdapter.Init() and stored as initErr,
// causing subsequent GetAndSetIdentifiers/Nuke calls to return the error gracefully.
panic(fmt.Sprintf("failed to create GCS client: %v", err))
r.InitializationError = fmt.Errorf("failed to create GCS client: %w", err)
return
}
r.Client = client
}),
Expand Down