fivetanley / ember-cli-migrator

migrate your files to the standard ember-cli structure, preserving git history
MIT License
106 stars 22 forks source link

Log filenames while parsing. #48

Closed estoner closed 9 years ago

estoner commented 9 years ago

This is an (extremely simple) attempt to resolve #31.

If esprima encounters a token it doesn't like, it dies without any useful error info (not even a mention of what the token is), and the user is left with no place to start debugging. All I did was change splitFile() to log the filename it's working on, which in my case was enough to fix the issue.

Maintainers: if you'd prefer a command-line --verbose flag to trigger this and keep it less chatty in normal use, let me know. Thanks for building a super useful utility! :heart: :heart: :heart:

fivetanley commented 9 years ago

Verbose would be awesome, but it'd be rad if it always did this in the error case. In the recast.parse case, can we wrap it in a try catch and log in the catch statement? Otherwise this is great :heart:

estoner commented 9 years ago

That makes total sense. I also added a log line that explains what the the problem likely is.

fivetanley commented 9 years ago

:heart: thanks!