Skip to content

Commit

Permalink
get the root cause of error and print its stack
Browse files Browse the repository at this point in the history
  • Loading branch information
teru01 committed May 12, 2024
1 parent 2bd45f5 commit f8d77fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ func (x *Error) Format(s fmt.State, verb rune) {
case 'v':
if s.Flag('+') {
_, _ = io.WriteString(s, x.Error())
x.st.Format(s, verb)
var c *Error
for c = x; c.cause != nil; c = c.cause.(*Error) {
}
c.st.Format(s, verb)
return
}
fallthrough
Expand Down

0 comments on commit f8d77fe

Please sign in to comment.