You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One thing I've noticed when running the cli is that the errors thrown are hard to map to which document (aka. which stumptown .json) was the cause.
Perhaps I don't know how to use sourcemaps in Node. (remember the cli is babel'ified into dist/cli.js) or perhaps it's just the nature of Node tracebacks being not great.
A quick fix would be to change, for example:
thrownewError(`prose section '${name}' is not optional and not present in document.prose`);
to something like:
thrownewError(
`prose section '${name}' is not optional and not present in document.prose (on ${document.title)`
);
...or something similar. That would make sense when using the cli and it might come in hand when we connect the cli with Travis. But it doesn't make sense to repeat the obvious when you're doing dev in the browser because which document it is is clear from the URL bar.
Another thing to ponder is that going into production; it might be nice to NOT throw errors and just use console.error() instead. So whatever we do we could leverage process.env.NODE_ENV.
The text was updated successfully, but these errors were encountered:
One thing I've noticed when running the cli is that the errors thrown are hard to map to which document (aka. which stumptown .json) was the cause.
Perhaps I don't know how to use sourcemaps in Node. (remember the cli is babel'ified into
dist/cli.js
) or perhaps it's just the nature of Node tracebacks being not great.A quick fix would be to change, for example:
to something like:
...or something similar. That would make sense when using the cli and it might come in hand when we connect the cli with Travis. But it doesn't make sense to repeat the obvious when you're doing dev in the browser because which document it is is clear from the URL bar.
Another thing to ponder is that going into production; it might be nice to NOT throw errors and just use
console.error()
instead. So whatever we do we could leverageprocess.env.NODE_ENV
.The text was updated successfully, but these errors were encountered: