Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Parser syntax errors should be passed to the callback, not thrown #12

rgrove opened this Issue · 3 comments

2 participants


When the parser encounters a syntax error, it currently throws a SyntaxError exception instead of bubbling it up to the render callback like I'd expect. Catching this exception is proving to be a challenge in an Express app. I'd much rather be able to handle it in my callback.


Can you gist this or post the code here?


This will throw a SyntaxError in Node (run it as a file, though; the REPL catches and hides the exception):

var dust    = require('dust'),
    context = dust.makeBase();

dust.renderSource('{<body}no end tag', context, function (err, html) {
    if (err) {
        console.log('I got an error!'); // never gets here

This should be an easy fix. I'll push it out in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.