Skip to content

Integration with try/catch #18

Closed
Closed

Description

@littledan

I've been hoping that we could eventually get some way of having multiple catch blocks which switch on which type of exception is thrown. The key here would be, if none of them match, it implicitly rethrows. This is a feature of most other languages with exceptions.

This pattern matching proposal ended up pretty differently from what might be more useful there. One problem is, we already do destructuring on the catch variable, so we can't start applying a different grammar.

Do you see extensions that would allow it to be used in a context like this? One alternative would be https://github.com/zenparsing/es-typed-catch . I guess the viability of this ties into the answer to #13 as well.

Activity

  1. littledan commented on Jul 4, 2017

    @littledan
    MemberAuthor

    Oh sorry, this is a duplicate of #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions