Skip to content

Commit

Permalink
Fix Exception.Error() output when e.val is nil and e is not
Browse files Browse the repository at this point in the history
  • Loading branch information
Valeriy Gorelov committed Jun 10, 2024
1 parent ccbae20 commit 2ac268b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,13 @@ func (e *Exception) String() string {
}

func (e *Exception) Error() string {
if e == nil || e.val == nil {
if e == nil {
return "<nil>"
}
var b bytes.Buffer
b.WriteString(e.val.String())
if e.val != nil {
b.WriteString(e.val.String())
}
e.writeShortStack(&b)
return b.String()
}
Expand Down

0 comments on commit 2ac268b

Please sign in to comment.