Skip to content

Commit

Permalink
Wrap errors with github.com/Scalingo/go-utils/errors/v2
Browse files Browse the repository at this point in the history
  • Loading branch information
francois2metz committed May 24, 2023
1 parent 1a04402 commit dd1b1db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions env/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"gopkg.in/errgo.v1"

errors2 "github.com/Scalingo/go-utils/errors/v2"
"github.com/Scalingo/cli/config"
"github.com/Scalingo/go-scalingo/v6"
"github.com/joho/godotenv"
Expand All @@ -25,12 +26,12 @@ var (
func Add(ctx context.Context, app string, params []string, filePath string) error {
variablesFromFile, err := readFromFile(filePath)
if err != nil {
return err
return errors2.Notef(ctx, err, "Could not read from file")
}

variablesFromCmdLine, err := readFromCmdLine(params)
if err != nil {
return err
return errors2.Notef(ctx, err, "Could not variables from command line")
}

variables := mergeVariables(variablesFromFile, variablesFromCmdLine)
Expand Down

0 comments on commit dd1b1db

Please sign in to comment.