cdiggins / myna-parser

Myna Parsing Library
https://cdiggins.github.io/myna-parser
MIT License
79 stars 16 forks source link

ParserError messages don't seem to be propogated #25

Open Fleker opened 5 years ago

Fleker commented 5 years ago

A grammar I'm developing seems to be throwing a ParserError, although I'm having a lot of trouble finding out exactly where the error is happening. To make matters more complicated, I seem to be unable to see the error messages that are coming out of the ParserError. It seems like the message parameter is not being propogated to the error object or accessible in the console.

Here's a simple test case.

> try { throw new Error('123') } catch (e) { console.error(e.toString()) }
Error: 123
undefined
> try { throw new ParserError('123') } catch (e) { console.error(e.toString()) }
Error
Fleker commented 5 years ago

Seems like you're calling super(message), although that doesn't seem to be having an effect. But manually setting the message property in the constructor does seem to have an effect.

Fleker commented 5 years ago

I get much better behavior on TypeScript 3.0+, so I think my dependency on this is out of date.

Fleker commented 5 years ago

Actually, now that I look at it some more, I'm going to reopen this. It seems like there hasn't been a release since the Typescript dependency has been updated, so this issue is still open.