Skip to content

Commit

Permalink
Merge pull request #579 from a-donda/error_call_fix
Browse files Browse the repository at this point in the history
Fix Exception.Error() output when e.val is nil and e is not
  • Loading branch information
dop251 authored Jun 10, 2024
2 parents c24c3bd + 2ac268b commit 10137d7
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 10137d7

Please sign in to comment.