Skip to content

Commit

Permalink
Fixes error interpolation case where err is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Moran committed Feb 23, 2022
1 parent 07ce8a2 commit 86f0343
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion postal/service.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package postal

import (
"errors"
"fmt"
"io"
"path/filepath"
Expand Down Expand Up @@ -179,7 +180,7 @@ func (s Service) Deliver(dependency Dependency, cnbPath, layerPath, platformPath
}

if !ok {
return fmt.Errorf("checksum does not match: %s", err)
return errors.New("failed to validate dependency: checksum does not match")
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion postal/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ version = "this is super not semver"
"",
)

Expect(err).To(MatchError(ContainSubstring("checksum does not match")))
Expect(err).To(MatchError("validation error: checksum does not match"))
})
})

Expand Down

0 comments on commit 86f0343

Please sign in to comment.