[NOD-375] Move to pkg/errors (#447)

* [NOD-375] Move to pkg/errors

* [NOD-375] Fix tests

* [NOD-375] Make AreErrorsEqual a shared function
This commit is contained in:
Ori Newman
2019-11-04 11:24:12 +02:00
committed by Dan Aharoni
parent 40657a83f5
commit c88fa1492e
152 changed files with 11289 additions and 2602 deletions

View File

@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"github.com/jinzhu/gorm"
"github.com/pkg/errors"
"net/http"
"strings"
)
@@ -54,7 +55,7 @@ func NewErrorFromDBErrors(prefix string, dbErrors []error) error {
for i, dbErr := range dbErrors {
dbErrorsStrings[i] = fmt.Sprintf("\"%s\"", dbErr)
}
return fmt.Errorf("%s [%s]", prefix, strings.Join(dbErrorsStrings, ","))
return errors.Errorf("%s [%s]", prefix, strings.Join(dbErrorsStrings, ","))
}
// NewHandlerErrorFromDBErrors takes a slice of database errors and a prefix, and