Skip to content

Try statements for specific exception types #113

@KCreate

Description

@KCreate

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions