mirror of
https://gitee.com/johng/gf.git
synced 2024-11-29 18:57:44 +08:00
improve gerror.Stack
This commit is contained in:
parent
662f1ed6b7
commit
4beeeb92ac
@ -199,7 +199,7 @@ func Cause(err error) error {
|
||||
}
|
||||
|
||||
// Stack returns the stack callers as string.
|
||||
// It returns an empty string if the <err> does not support stacks.
|
||||
// It returns the error string directly if the <err> does not support stacks.
|
||||
func Stack(err error) string {
|
||||
if err == nil {
|
||||
return ""
|
||||
@ -207,7 +207,7 @@ func Stack(err error) string {
|
||||
if e, ok := err.(apiStack); ok {
|
||||
return e.Stack()
|
||||
}
|
||||
return ""
|
||||
return err.Error()
|
||||
}
|
||||
|
||||
// Current creates and returns the current level error.
|
||||
|
Loading…
Reference in New Issue
Block a user