From 3a468daa8f0256b721b1b83f22b81e7bb0de3842 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Wed, 8 Nov 2023 11:15:46 -0800 Subject: [PATCH] services/google/pubsub: fix dropped errors --- services/google/pubsub/alpha/topic_internal.go | 11 +++++++---- services/google/pubsub/beta/topic_internal.go | 11 +++++++---- services/google/pubsub/topic_internal.go | 11 +++++++---- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/services/google/pubsub/alpha/topic_internal.go b/services/google/pubsub/alpha/topic_internal.go index 3a881830be..245540009d 100755 --- a/services/google/pubsub/alpha/topic_internal.go +++ b/services/google/pubsub/alpha/topic_internal.go @@ -1,11 +1,11 @@ // Copyright 2023 Google LLC. All Rights Reserved. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// +// +// http://www.apache.org/licenses/LICENSE-2.0 +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -341,6 +341,9 @@ func (op *createTopicOperation) do(ctx context.Context, r *Topic, c *Client) err } return getResp, nil }, c.Config.RetryProvider) + if err != nil { + return err + } if _, err := c.GetTopic(ctx, r); err != nil { c.Config.Logger.WarningWithContextf(ctx, "get returned error: %v", err) diff --git a/services/google/pubsub/beta/topic_internal.go b/services/google/pubsub/beta/topic_internal.go index aeaf1d2195..049cb7bc22 100755 --- a/services/google/pubsub/beta/topic_internal.go +++ b/services/google/pubsub/beta/topic_internal.go @@ -1,11 +1,11 @@ // Copyright 2023 Google LLC. All Rights Reserved. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// +// +// http://www.apache.org/licenses/LICENSE-2.0 +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -341,6 +341,9 @@ func (op *createTopicOperation) do(ctx context.Context, r *Topic, c *Client) err } return getResp, nil }, c.Config.RetryProvider) + if err != nil { + return err + } if _, err := c.GetTopic(ctx, r); err != nil { c.Config.Logger.WarningWithContextf(ctx, "get returned error: %v", err) diff --git a/services/google/pubsub/topic_internal.go b/services/google/pubsub/topic_internal.go index 96b157239b..a798fb3395 100755 --- a/services/google/pubsub/topic_internal.go +++ b/services/google/pubsub/topic_internal.go @@ -1,11 +1,11 @@ // Copyright 2023 Google LLC. All Rights Reserved. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// +// +// http://www.apache.org/licenses/LICENSE-2.0 +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -341,6 +341,9 @@ func (op *createTopicOperation) do(ctx context.Context, r *Topic, c *Client) err } return getResp, nil }, c.Config.RetryProvider) + if err != nil { + return err + } if _, err := c.GetTopic(ctx, r); err != nil { c.Config.Logger.WarningWithContextf(ctx, "get returned error: %v", err)