--define:nimQuirky exception handling for Nim; in preparation of a blog post

This commit is contained in:
Andreas Rumpf 2019-01-03 18:56:05 +01:00
commit cb9110c43d
7 changed files with 77 additions and 32 deletions

View file

@ -357,6 +357,8 @@ proc raiseExceptionAux(e: ref Exception) =
raiseCounter.inc # skip zero at overflow
e.raiseId = raiseCounter
{.emit: "`e`->raise();".}
elif defined(nimQuirky):
if currException == nil: currException = e
else:
if excHandler != nil:
if not excHandler.hasRaiseAction or excHandler.raiseAction(e):