duojs / duo

A next-generation package manager for the front-end
3.42k stars 118 forks source link

Handle syntax errors in manifests more gracefully #413

Closed dominicbarnes closed 9 years ago

dominicbarnes commented 9 years ago

When we get a SyntaxError from readJson, the error object itself will be decorated/modified for better printing. (every other case still behaves the same)

In the duo(1) CLI, it will treat the decorated SyntaxError as a special-case, and print w/o a stack trace. Instead, it includes the error and filename relative to pwd. I thought about using root instead, but figured since we were printing on the CLI, it would make more sense to be relative to the pwd.

This fixes #408

dominicbarnes commented 9 years ago

@stephenmathieson done :)

stephenmathieson commented 9 years ago

lgtm!