diff options
Diffstat (limited to 'api/api.go')
-rw-r--r-- | api/api.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -58,6 +58,9 @@ func ErrorIs(err error, code ErrorCode) bool { | |||
58 | } | 58 | } |
59 | 59 | ||
60 | func NewInternalError(err error) *Error { | 60 | func NewInternalError(err error) *Error { |
61 | if apiError, ok := err.(*Error); ok { | ||
62 | return apiError | ||
63 | } | ||
61 | return &Error{InternalError, "internal error", err} | 64 | return &Error{InternalError, "internal error", err} |
62 | } | 65 | } |
63 | 66 | ||