rails / ruby-coffee-script

Ruby CoffeeScript Compiler
http://coffeescript.org/
MIT License
28 stars 49 forks source link

Missing context in SyntaxError exceptions #4

Closed diclophis closed 5 years ago

diclophis commented 9 years ago

Due to the wrapping and mutating of SyntaxErrors here: https://github.com/rails/ruby-coffee-script/blob/master/lib/coffee_script.rb#L29

The full context/message of the coffeescript syntax error is missing.

Note the first screenshot shows the current error message when we have a coffeescript error missing-context

This second screenshot is the same error, except with the "wrapper" code on line #29 of coffee_script.rb removed... with-context

Can the wrapper code be updated to better capture more context of coffeescript errors, and or is the wrapping and special handling of SyntaxErrors necessary at all?

Schwad commented 8 years ago

THIS

diclophis commented 8 years ago

haha, @Schwad could you elaborate on your comment a bit... I have a patch pending here for this issue: https://github.com/rails/ruby-coffee-script/pull/8

Schwad commented 8 years ago

The causes of our errors might be different, mine wasn't even showing a file properly, it appears the break was from running sprockets 4.0.0.beta.2 on my machine, as I'm no longer running the error. It's just when I was running into coffeescript errors historically it was not verbose in the source.