|
@@ -91,6 +91,10 @@ func New(e interface{}) *Error {
|
|
|
// fmt.Errorf("%v"). The skip parameter indicates how far up the stack
|
|
// fmt.Errorf("%v"). The skip parameter indicates how far up the stack
|
|
|
// to start the stacktrace. 0 is from the current call, 1 from its caller, etc.
|
|
// to start the stacktrace. 0 is from the current call, 1 from its caller, etc.
|
|
|
func Wrap(e interface{}, skip int) *Error {
|
|
func Wrap(e interface{}, skip int) *Error {
|
|
|
|
|
+ if e == nil {
|
|
|
|
|
+ return nil
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
var err error
|
|
var err error
|
|
|
|
|
|
|
|
switch e := e.(type) {
|
|
switch e := e.(type) {
|
|
@@ -117,6 +121,9 @@ func Wrap(e interface{}, skip int) *Error {
|
|
|
// up the stack to start the stacktrace. 0 is from the current call,
|
|
// up the stack to start the stacktrace. 0 is from the current call,
|
|
|
// 1 from its caller, etc.
|
|
// 1 from its caller, etc.
|
|
|
func WrapPrefix(e interface{}, prefix string, skip int) *Error {
|
|
func WrapPrefix(e interface{}, prefix string, skip int) *Error {
|
|
|
|
|
+ if e == nil {
|
|
|
|
|
+ return nil
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
err := Wrap(e, 1+skip)
|
|
err := Wrap(e, 1+skip)
|
|
|
|
|
|