Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asynchronous procedures losing current exception in exception handler. #12764

Open
cheatfate opened this issue Nov 28, 2019 · 0 comments
Open
Assignees
Labels
Async Everything related to Nim's async

Comments

@cheatfate
Copy link
Member

cheatfate commented Nov 28, 2019

Example

import asyncdispatch

proc test1() {.async.} =
  try:
    raise newException(ValueError, "Test1")
  except:
    await sleepAsync(200)
    raise

when isMainModule:
  waitFor test1()

Current Output

Exception message: no exception to reraise
Exception type: [ReraiseError]

Expected Output

Exception message: Test1
Exception type: [ValueError]
cheatfate added a commit to vacp2p/nim-libp2p that referenced this issue Nov 28, 2019
Remove usage of getCurrentException().
@yglukhov yglukhov self-assigned this Nov 29, 2019
@cheatfate cheatfate changed the title Asynchronous procedures loosing current exception in exception handler. Asynchronous procedures losing current exception in exception handler. Nov 29, 2019
dryajov added a commit to vacp2p/nim-libp2p that referenced this issue Nov 29, 2019
dryajov pushed a commit to vacp2p/nim-libp2p that referenced this issue Dec 3, 2019
Remove usage of getCurrentException().
@ghost ghost added the Async Everything related to Nim's async label Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Async Everything related to Nim's async
Projects
None yet
Development

No branches or pull requests

2 participants