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

Exceptions in actions #22

Closed
JonathanMEdwards opened this issue Jun 4, 2015 · 3 comments
Closed

Exceptions in actions #22

JonathanMEdwards opened this issue Jun 4, 2015 · 3 comments

Comments

@JonathanMEdwards
Copy link
Contributor

When I throw an exception inside a semantic action it turns into a TypeError exception. Is there a supported way to do this?

@alexwarth
Copy link
Contributor

I just edited the math demo to throw an Error from the AddExp_plus case of the interpret operation:

      ...,
      AddExp_plus: function(x, _, y) {
        throw new Error('uh-oh');
        return x.interpret() + y.interpret();
      },
      ...,

and when I load that page, the console shows what I expected: Uncaught Error: uh-oh. So I'm not sure what's causing the TypeError you're seeing. Can you include more details so I can try to reproduce this problem on my end? (Well, it probably makes more sense for us to look at this together tomorrow morning, since you're around.)

@JonathanMEdwards
Copy link
Contributor Author

Sorry my bad.
Note to self: don't open issues late at night.

On Wed, Jun 3, 2015 at 11:52 PM, Alessandro Warth notifications@github.com
wrote:

I just edited the math demo to throw an Error from the AddExp_plus case
of the interpret operation:

  ...,
  AddExp_plus: function(x, _, y) {
    throw new Error('uh-oh');
    return x.interpret() + y.interpret();
  },
  ...,

and when I load that page, the console shows what I expected: Uncaught
Error: uh-oh. So I'm not sure what's causing the TypeError you're seeing.
Can you include more details so I can try to reproduce this problem on my
end? (Well, it probably makes more sense for us to look at this together
tomorrow morning, since you're around.)


Reply to this email directly or view it on GitHub
#22 (comment).

@alexwarth
Copy link
Contributor

LOL

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

2 participants