mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
Show the name of the unexpected exception that was thrown in std/unittest (#23087)
Show name of error that wasn't expected in an `expect` block
This commit is contained in:
@@ -773,7 +773,8 @@ macro expect*(exceptions: varargs[typed], body: untyped): untyped =
|
||||
except errorTypes:
|
||||
discard
|
||||
except:
|
||||
checkpoint(lineInfoLit & ": Expect Failed, unexpected exception was thrown.")
|
||||
let err = getCurrentException()
|
||||
checkpoint(lineInfoLit & ": Expect Failed, " & $err.name & " was thrown.")
|
||||
fail()
|
||||
{.pop.}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user