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

Try statements for specific exception types #113

Open
KCreate opened this issue Jul 29, 2022 · 0 comments
Open

Try statements for specific exception types #113

KCreate opened this issue Jul 29, 2022 · 0 comments
Labels

Comments

@KCreate
Copy link
Owner

KCreate commented Jul 29, 2022

The following syntax should be possible

try {
    foo()
} catch SomeException {
    // catches only exceptions of type SomeException, doesn't provide a binding
} catch OtherException as exc {
    // catches only exceptions of type OtherException, provides a binding (exc)
} catch exc {
    // catches all types of exceptions, provides a binding (exc)
} catch {
    // catches all types of exceptions, doesn't provide a binding
}

Could use the instanceof operation described in #64 to perform a typecheck at the beginning of the exception handler, then dispatch to correct handler.

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

No branches or pull requests

1 participant