distinguish between full trace (with message) and just trace
This commit is contained in:
parent
8b2b5a6bff
commit
a8fd5b2cbd
1 changed files with 10 additions and 1 deletions
11
errors.go
11
errors.go
|
@ -39,8 +39,17 @@ func Prefix(prefix string, err interface{}) error {
|
||||||
return errors.WrapPrefix(Err(err), prefix, 0)
|
return errors.WrapPrefix(Err(err), prefix, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trace returns the error message and the stack trace
|
// Trace returns the stack trace
|
||||||
func Trace(err error) string {
|
func Trace(err error) string {
|
||||||
|
if err == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return string(errors.Wrap(Err(err), 0).Stack())
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FullTrace returns the error type, message, and stack trace
|
||||||
|
func FullTrace(err error) string {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue