Skip to content

Commit

Permalink
better error message on unexpected exception (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnetheduck committed Aug 17, 2021
1 parent 4c2ce01 commit f1d70db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions unittest2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,9 @@ macro expect*(exceptions: varargs[typed], body: untyped): untyped =
fail()
except errorTypes:
discard
except:
checkpoint(lineInfoLit & ": Expect Failed, unexpected exception was thrown.")
except Exception as e:
checkpoint(lineInfoLit & ": Expect Failed, unexpected " & $e.name &
" (" & e.msg & ") was thrown.\n" & e.getStackTrace())
fail()

var errorTypes = newNimNode(nnkBracket)
Expand Down

0 comments on commit f1d70db

Please sign in to comment.