doAssertRaises improvements; nimscript supports except Exception as e (#15765)

* doAssertRaises now correctly handles foreign exceptions; now shows which exception is raised on mismatch
* nimscript now handles `Exception as e`
* remove catch-all doAssertRaises overload from this PR

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
Timothee Cour 2020-11-12 02:25:41 -06:00 • committed by GitHub
commit e5db5316c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 11 deletions

View file

@ -2360,7 +2360,8 @@ when notJSnotNims and hostOS != "standalone":
##
## **Warning**: Only use this if you know what you are doing.
currException = exc
elif defined(nimscript):
proc getCurrentException*(): ref Exception {.compilerRtl.} = discard
when notJSnotNims:
{.push stackTrace: off, profiler: off.}