Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
cli: fix error mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Sep 24, 2024
1 parent adf4ae8 commit 861944c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/sst/cli/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (c *Cli) InitProject() (*project.Project, error) {
}

if err := p.LoadHome(); err != nil {
return nil, util.NewReadableError(err, err.Error())
return nil, err
}

app := p.App()
Expand Down
7 changes: 4 additions & 3 deletions cmd/sst/mosaic/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ func Transform(err error) error {
project.ErrVersionMismatch,
}

match, ok := mapping[err]
if ok {
return util.NewReadableError(err, match)
for compare, msg := range mapping {
if errors.Is(err, compare) {
return util.NewReadableError(err, msg)
}
}

for _, r := range readable {
Expand Down

0 comments on commit 861944c

Please sign in to comment.