Closed sdmcallister closed 1 year ago
Can you try this outside jester (for example in an async proc) and see if it's the same? Just to ensure this is a jester-specific issue
@dom96 Thanks!
If you mean some thing like what is below, the following code works as expected with only 1 finally block.
import asyncdispatch
proc tryFinally(){.async.} =
try:
echo "trying"
raise
except:
echo "exception caught"
finally:
echo "finally block"
waitFor tryFinally()
Looks like this is indeed a Nim bug. Jester uses break
to break out of routes, adding a break
in the except block reproduces this.
import asyncdispatch
proc tryFinally(){.async.} =
block route:
try:
echo "trying"
raise
except:
echo "exception caught"
break route
finally:
echo "finally block"
In my terminal I see the following, but I would expect finally block to only be called once.
MWE: