mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 09:18:31 +02:00
fix: tests
This commit is contained in:
@@ -41,18 +41,6 @@ func Wrap(err error, message ...string) Error {
|
||||
return &baseError{fmt.Errorf("%s: %w", message[0], err)}
|
||||
}
|
||||
|
||||
func wrap(err error) Error {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
//nolint:errorlint
|
||||
switch err := err.(type) {
|
||||
case Error:
|
||||
return err
|
||||
}
|
||||
return &baseError{err}
|
||||
}
|
||||
|
||||
func Unwrap(err error) Error {
|
||||
//nolint:errorlint
|
||||
switch err := err.(type) {
|
||||
@@ -65,6 +53,18 @@ func Unwrap(err error) Error {
|
||||
}
|
||||
}
|
||||
|
||||
func wrap(err error) Error {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
//nolint:errorlint
|
||||
switch err := err.(type) {
|
||||
case Error:
|
||||
return err
|
||||
}
|
||||
return &baseError{err}
|
||||
}
|
||||
|
||||
func IsJSONMarshallable(err error) bool {
|
||||
switch err := err.(type) {
|
||||
case *nestedError, *withSubject:
|
||||
|
||||
Reference in New Issue
Block a user