From 861944c31e5bf71aee5f47e7265280266aa9ecd7 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Tue, 24 Sep 2024 12:25:46 -0400 Subject: [PATCH] cli: fix error mapping --- cmd/sst/cli/project.go | 2 +- cmd/sst/mosaic/errors/errors.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/sst/cli/project.go b/cmd/sst/cli/project.go index 8c18682a8..0574bfa20 100644 --- a/cmd/sst/cli/project.go +++ b/cmd/sst/cli/project.go @@ -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() diff --git a/cmd/sst/mosaic/errors/errors.go b/cmd/sst/mosaic/errors/errors.go index 6da9d1555..cccb9c8cb 100644 --- a/cmd/sst/mosaic/errors/errors.go +++ b/cmd/sst/mosaic/errors/errors.go @@ -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 {