Closed
Description
Description
The following code should fail with an AssertionDefect error, but it does not.
import std/asyncdispatch
proc errval {.async.} =
raise newException(ValueError, "err")
proc err {.async.} =
try:
doAssert false
finally:
echo "finally"
# removing the following code will propagate the AssertionDefect
try:
await errval()
except ValueError:
echo "valueError"
proc main {.async.} =
let errFut = err()
await errFut
waitFor main()
Nim Version
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2024-05-11
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: c91b33a
active boot switches: -d:release
Current Output
finally
valueError
Expected Output
finally
valueError
[AssertionDefect]
Possible Solution
No response
Additional Information
No response