|
|
@ -22,6 +22,7 @@ import ( |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"path" |
|
|
|
"path" |
|
|
|
|
|
|
|
"reflect" |
|
|
|
"runtime" |
|
|
|
"runtime" |
|
|
|
"strconv" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
@ -33,6 +34,7 @@ import ( |
|
|
|
type Error struct { |
|
|
|
type Error struct { |
|
|
|
EmbeddedError error `json:"-"` |
|
|
|
EmbeddedError error `json:"-"` |
|
|
|
ErrorMessage string |
|
|
|
ErrorMessage string |
|
|
|
|
|
|
|
ErrorType string |
|
|
|
|
|
|
|
|
|
|
|
Stack []StackEntry |
|
|
|
Stack []StackEntry |
|
|
|
} |
|
|
|
} |
|
|
@ -106,6 +108,7 @@ func New(err error, data map[string]string) error { |
|
|
|
newErr = Error{ |
|
|
|
newErr = Error{ |
|
|
|
EmbeddedError: err, |
|
|
|
EmbeddedError: err, |
|
|
|
ErrorMessage: err.Error(), |
|
|
|
ErrorMessage: err.Error(), |
|
|
|
|
|
|
|
ErrorType: reflect.TypeOf(err).String(), |
|
|
|
Stack: []StackEntry{}, |
|
|
|
Stack: []StackEntry{}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|