Skip to content

Commit 1db735d

Browse files
committed
platform channel search returns ErrNotFound if not found, not gql error string
so we need to check for this too
1 parent 3ee687a commit 1db735d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

client/channel.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/pkg/errors"
88
channels "github.com/replicatedhq/replicated/gen/go/v1"
9+
"github.com/replicatedhq/replicated/pkg/platformclient"
910
"github.com/replicatedhq/replicated/pkg/types"
1011
)
1112

@@ -100,7 +101,7 @@ func (c *Client) GetOrCreateChannelByName(appID string, appType string, appSlug
100101
ReleaseSequence: channel.ReleaseSequence,
101102
ReleaseLabel: channel.ReleaseLabel,
102103
}, nil
103-
} else if !strings.Contains(err.Error(), gqlNotFoundErr) {
104+
} else if !strings.Contains(err.Error(), gqlNotFoundErr) && !errors.Is(err, platformclient.ErrNotFound) {
104105
return nil, errors.Wrap(err, "get channel")
105106
}
106107

pkg/platformclient/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"io"
88
)
99

10-
// ErrNotFound represnets a 404 response from the API.
10+
// ErrNotFound represents a 404 response from the API.
1111
var ErrNotFound = errors.New("Not found")
1212

1313
// BadRequest represents a 400 response from the API.

0 commit comments

Comments
 (0)