Skip to content

Commit

Permalink
Replaced the panic statement with error in `google_secret_manager_sec…
Browse files Browse the repository at this point in the history
…ret_version` resource import function (GoogleCloudPlatform#8923)
  • Loading branch information
abheda-crest authored and nevzheng committed Sep 22, 2023
1 parent 589e919 commit 8e269ed
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

parts := secretRegex.FindStringSubmatch(name)
if len(parts) != 2 {
panic(fmt.Sprintf("Version name does not fit the format `projects/{{project}}/secrets/{{secret}}/versions/{{version}}`"))
return nil, fmt.Errorf("Version name does not fit the format `projects/{{project}}/secrets/{{secret}}/versions/{{version}}`")
}
if err := d.Set("secret", parts[1]); err != nil {
return nil, fmt.Errorf("Error setting secret: %s", err)
Expand Down

0 comments on commit 8e269ed

Please sign in to comment.