diff --git a/domains/list.go b/domains/list.go index 6e804f520..81099e5ba 100644 --- a/domains/list.go +++ b/domains/list.go @@ -6,10 +6,10 @@ import ( "os" "github.com/olekukonko/tablewriter" - "gopkg.in/errgo.v1" "github.com/Scalingo/cli/config" scalingo "github.com/Scalingo/go-scalingo/v6" + "github.com/Scalingo/go-utils/errors/v2" ) var letsencryptStatusString = map[string]string{ @@ -23,11 +23,12 @@ var letsencryptStatusString = map[string]string{ func List(ctx context.Context, app string) error { c, err := config.ScalingoClient(ctx) if err != nil { - return errgo.Notef(err, "fail to get Scalingo client") + return errors.Wrapf(ctx, err, "get Scalingo client to list domains") } + domains, err := c.DomainsList(ctx, app) if err != nil { - return errgo.Mask(err) + return errors.Wrapf(ctx, err, "list domains") } t := tablewriter.NewWriter(os.Stdout)