|
|
@@ -41,7 +41,9 @@ func (w *withStack) Format(s fmt.State, verb rune) {
|
|
|
switch verb {
|
|
|
case 'v':
|
|
|
if s.Flag('+') {
|
|
|
- _, _ = fmt.Fprintf(s, "%+v", w.Cause())
|
|
|
+ if w.Cause() != nil {
|
|
|
+ _, _ = fmt.Fprintf(s, "%+v", w.Cause())
|
|
|
+ }
|
|
|
w.stack.Format(s, verb)
|
|
|
return
|
|
|
}
|
|
|
@@ -66,7 +68,9 @@ func (w *withMessage) Format(s fmt.State, verb rune) {
|
|
|
case 'v':
|
|
|
if s.Flag('+') {
|
|
|
_, _ = io.WriteString(s, w.msg+": ")
|
|
|
- _, _ = fmt.Fprintf(s, "%+v\n", w.Cause())
|
|
|
+ if w.Cause() != nil {
|
|
|
+ _, _ = fmt.Fprintf(s, "%+v", w.Cause())
|
|
|
+ }
|
|
|
return
|
|
|
}
|
|
|
fallthrough
|
|
|
@@ -90,7 +94,9 @@ func (w *withCode) Format(s fmt.State, verb rune) {
|
|
|
case 'v':
|
|
|
if s.Flag('+') {
|
|
|
_, _ = io.WriteString(s, w.Msg+"\n")
|
|
|
- _, _ = fmt.Fprintf(s, "%+v\n", w.Cause())
|
|
|
+ if w.Cause() != nil {
|
|
|
+ _, _ = fmt.Fprintf(s, "%+v", w.Cause())
|
|
|
+ }
|
|
|
return
|
|
|
}
|
|
|
fallthrough
|