Search code examples
symfonysulu

Sulu: How to get the exact location of template errors in preview?


When I develop templates in Sulu 1.6 and an error occurs, where can I find the full error or exact error location? Is there some kind of special log or do I need to change the default location?

The corresponding /admin/websocket/admin response contains only this (basically the same information):

{
   "handler":"sulu_preview.preview",
   "message":{
     "code":9903,
     "message":"Unclosed \"block\".",
     "type":"Sulu\\Bundle\\PreviewBundle\\Preview\\Exception\\TwigException"
   },
   "options":[],
   "error":true
} 

Currently I only see messages like this: Not very helpful template error

It would be also helpful to know, where the catch block for this is, in case it is not jet implemented.

Thx a lot!


Solution

  • So it turned out, that there is no logging enabled, and because the PreviewRendere throws a new Exception, the original information is pretty much lost. It can be added in this way: https://github.com/sulu/sulu/pull/4363

    Best wishes
    Andreas