better error message on unexpected exception (#10)
This commit is contained in:
parent
4c2ce01e34
commit
f1d70dbb8c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue