mirror of
https://github.com/kaspanet/kaspad.git
synced 2026-02-21 03:03:08 +00:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user