Merge pull request #93 from rusenask/feature/error_handling_pubsub

no error handling
pull/94/head
Karolis Rusenas 2017-08-23 08:40:00 +01:00 committed by GitHub
commit 1539d4295a
1 changed files with 6 additions and 2 deletions

View File

@ -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