Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show error message when aborting due to nunjucks error #265

Closed
damithc opened this issue Jun 13, 2018 · 2 comments · Fixed by #721
Closed

Show error message when aborting due to nunjucks error #265

damithc opened this issue Jun 13, 2018 · 2 comments · Fixed by #721

Comments

@damithc
Copy link
Contributor

damithc commented Jun 13, 2018

Context: I have a need to generate several variations of the same site. As markbind doesn't have syntax to support conditional variations yet, I've resorted to using nunjucks code (on top of markbind) for the time being. example

Current: If there is an error in nunjucks code (e.g., importing a file that doesn't exist), the build fails silently. Same applies to live preview.

Suggested: instead of failing silently, show some error information from nunjucks

@damithc
Copy link
Contributor Author

damithc commented Jun 13, 2018

@rachx any thoughts?

@rachx
Copy link
Contributor

rachx commented Jun 14, 2018

We should be able to report the error/problematic file in the console if we add some error handling when using nunjucks.

const fileContent = nunjucks.renderString(data, userDefinedVariables);

If this throws an error, we should also use the reject handler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants