Bug 730708 trap and report errors#1
Conversation
Need the bleeding edge revision, since it exposes the current character offset to parsing. That helps pass along more context to error reporting.
* Collect errors during macro processing, wrap more bits try/catch * Transmit errors as firelogger log messages * Use a firelogger-compatible middleware to transport log messages in HTTP headers in the response * Switch from `async.forEach` to `async.queue` in macro execution * Make the template and loader classes configurable by name.
|
I can take a look - I just need to go into my kumascript submodule, pull this branch, and restart kumascript? |
|
You should switch the kuma branch to the one in the other pull request, then do: If you just update kumascript, you'll miss the config changes |
There was a problem hiding this comment.
Not sure. Seems nice to try to execute as much of the template as possible. Let's wait to decide until we get user feedback.
There was a problem hiding this comment.
Well, the question here is what to render into the page when a macro fails. This code renders {{ FooTemplate }} if executing FooTemplate() fails with an error. That doesn't provide any context.
I'm wondering if there's something more useful to render here - such as a big red MindTouch-like error placeholder with a link to the anchor of a log message (to be rendered in the implementation of bug 733831). But, I'd want to make that inline error message configurable and localizable from kuma. So, that would probably be another template to worry about.
There was a problem hiding this comment.
Let's point it out to the doc/template authors to see what they want.
Test pass, works locally. Ship it!
Enable the FileLoader to handle absolute paths for the macro root directory.
I may end up merging this myself, but I wanted to at least start trying to change to the same PR and review process we use on mozilla/kuma
Long story short, this code:
Also, this involves an update of the pegjs package used to parse kuma wiki documents. I'm not entirely happy with that, since it's a pre-release. But, it's the first release that supplies the character position where a macro was parsed, thus offering some context to kumascript macro errors.