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

Allow yielding from error handlers #56

Open
lionel- opened this issue Oct 30, 2024 · 0 comments
Open

Allow yielding from error handlers #56

lionel- opened this issue Oct 30, 2024 · 0 comments

Comments

@lionel-
Copy link
Member

lionel- commented Oct 30, 2024

As in JS and Python:

my_gen <- generator(function() {
  tryCatch(
    1 + "",
    error = function(cnd) yield("handled")
  )
})

The error handler should be a separate nested state machine. When entered, the handler is popped off the stack of active handlers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant