Skip to content

Commit

Permalink
change IsNotFoundError func to public
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed May 9, 2022
1 parent 08a563c commit 73be2b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/rpaas/client/autoscale.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (args UpdateAutoscaleArgs) Validate() error {
func (c *client) shouldCreate(ctx context.Context, instance string) (bool, error) {
_, err := c.GetAutoscale(ctx, GetAutoscaleArgs{Instance: instance})
if err != nil {
if isNotFoundError(err) {
if IsNotFoundError(err) {
return true, nil
}
return false, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/rpaas/client/internal_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func newErrUnexpectedStatusCodeFromResponse(r *http.Response) error {
return &ErrUnexpectedStatusCode{Status: r.StatusCode, Body: string(body)}
}

func isNotFoundError(err error) bool {
func IsNotFoundError(err error) bool {
if httpErr, ok := err.(*ErrUnexpectedStatusCode); ok {
if httpErr.Status == http.StatusNotFound {
return true
Expand Down

0 comments on commit 73be2b8

Please sign in to comment.