Expose filename when syntax error occurs #257

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

parshap commented Dec 21, 2012

When a syntax error occurs the bundle object emits a syntaxError event with an object that includes some info such as the line number, but it does tell you which file the syntax error occurred in. The change is pretty minor and basically sets err.file to the filename before the event is emitted.

I am not sure if this the right approach. I saw that there is a wrap.errors object, but it doesn't seem that the wrap object is exposed through the bundle and even if it was it doesn't look like all errors are added to that wrap.errors object as my bundle.ok is true even after a syntax error is emitted.

Contributor

js-n commented Dec 28, 2012

👍

Owner

substack commented Feb 22, 2013

v2 now emits a proper 'error' event but putting a .file property on the error object would make sense

substack closed this Feb 22, 2013

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