Skip to content

Commit

Permalink
Merge pull request #8 from MisterMX/feat/get-compose-error-not-found
Browse files Browse the repository at this point in the history
fix(error): Incorrect IsErrorNotFound behaviour
  • Loading branch information
MisterMX authored Feb 15, 2024
2 parents d89f4d0 + b57d73c commit b9dcf39
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion error.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type errNotFound struct {
}

func NewErrorNotFound(name string) error {
return &errNotFound{name: name}
return errNotFound{name: name}
}

func (e errNotFound) Error() string {
Expand Down
10 changes: 9 additions & 1 deletion error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ func TestIsErrorNotFound(t *testing.T) {
}{
"ExpectTrue": {
args: args{
err: errNotFound{},
err: NewErrorNotFound("not-found"),
},
want: want{
isNotFound: true,
},
},
"ExpectWrappedTrue": {
args: args{
err: errors.Wrap(NewErrorNotFound("not-found"), "wrap"),
},
want: want{
isNotFound: true,
Expand Down

0 comments on commit b9dcf39

Please sign in to comment.