-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Need more info for parsing error report #50
Comments
With a $pug = new \Pug\Pug();
try {
$pug->render('your-template');
} catch (\Exception $e) {
echo '<pre>' . $e->getTraceAsString() . '</pre>';
} And you should see what method of Compiler is called and where in the generated PHP code. It should be just before |
We could pass to Compiler methods some parsing infos (template file, template line of the original parsed code) when some "debug" option would be true. |
I found a way to inject more informations (pug node type, tag name when it's a tag, file line and file name when it's rendered from a pug file) on the fly in the exceptions thrown. It weel be implemented in the next release with no need to set any option since thoses errors occurs during compilation and not during rendering. |
* #50 More debug infos * Enable isInline on every nodes
With the new version 2.2.1, you should have information about, the tag, file and line where errors happen. |
pug-php 3 comes with the new error handling system of https://github.com/phug-php/phug and now provides the line and offset from the Pug source file. |
I just got many errors like:
Such error report is not very helpful. I guess it come from some syntax error in my pug source, but current error report give no clue.
The text was updated successfully, but these errors were encountered: