Skip to content

Commit

Permalink
fix: make subscription not exists error non-dynamic (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
sermojohn committed Mar 27, 2023
1 parent 0acd9d9 commit a77eb8c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ const (
var (
// ErrSubscriptionStopped a special error which forces the subscription stop
ErrSubscriptionStopped = errors.New("subscription stopped")
// ErrSubscriptionNotExists an error denoting that subscription does not exist
ErrSubscriptionNotExists = errors.New("subscription does not exist")

errRetry = errors.New("retry subscription client")
)
Expand Down Expand Up @@ -663,7 +665,7 @@ func (sc *SubscriptionClient) Unsubscribe(id string) error {
sub := ctx.GetSubscription(id)

if sub == nil {
return fmt.Errorf("subscription id %s doesn't not exist", id)
return fmt.Errorf("%s, %w", id, ErrSubscriptionNotExists)
}

if sub.status == SubscriptionUnsubcribed {
Expand Down

0 comments on commit a77eb8c

Please sign in to comment.