Improve parsing exception messages
Fluid Parsing Exceptions should contain the path and linenumber of the affected template for easier bug fixing.
#1 Updated by Bastian Waidelich almost 10 years ago
- File 4704_Improve_parsing_exception_messages.patch View added
- Status changed from New to Needs Feedback
Attached is a very first version of a patch that includes template path, linenumber and current template extract to the exception messages of the template parser.
It still needs fine-tuning (e.g. the css styles should not be hardcoded in the error message of course), testing & probably better error handling.
Note: The "verbose" exception message is only active if \F3\Fluid\Fluid::$debugMode is TRUE
Note²: The patch has a sideeffect, it won't allow tags in view helper arguments. But I think, this should not be allowed anyways (and it makes Fluid slightly faster to skip those three regex lookups)
@anyone, please give feedback
#3 Updated by Bastian Waidelich about 9 years ago
- Status changed from Needs Feedback to Accepted
We decided, that we need to decouple this feature from the core.
We want to implement a hook mechanism that allows us to intercept the parsing process and count line numbers etc.
This hook will only be active in a special verbose mode. In FLOW3 this mode will be activated in Development Context by default. in v4 this could be enabled through the Extension Manager or through the devIPMask setting for example.
This won't use the TYPO3 hook implementation as the TemplateParser is not part of the public API (and because we don't want to have any $GLOBALS in Fluid). But it would be possible to attach your own hooks by writing your own TemplateView class.