From 1f4917559a001d47ada97919fcf82c1d15bbb5ea Mon Sep 17 00:00:00 2001 From: Karolis Rusenas Date: Wed, 23 Aug 2017 08:36:35 +0100 Subject: [PATCH] no error handling --- trigger/pubsub/pubsub.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trigger/pubsub/pubsub.go b/trigger/pubsub/pubsub.go index 16e9cb4e..0040043e 100644 --- a/trigger/pubsub/pubsub.go +++ b/trigger/pubsub/pubsub.go @@ -5,11 +5,12 @@ import ( "fmt" "time" + "net" + "cloud.google.com/go/pubsub" "golang.org/x/net/context" "google.golang.org/api/option" "google.golang.org/grpc" - "net" "github.com/rusenask/keel/provider" "github.com/rusenask/keel/types" @@ -106,7 +107,10 @@ func (s *PubsubSubscriber) ensureSubscription(ctx context.Context, subscriptionI Topic: s.client.Topic(topicID), AckDeadline: 10 * time.Second, }) - return fmt.Errorf("failed to create subscription %s, error: %s", subscriptionID, err) + if err != nil { + return fmt.Errorf("failed to create subscription %s, error: %s", subscriptionID, err) + } + return nil } // Subscribe - initiate PubsubSubscriber