14 Mar
2014
14 Mar
'14
12:57 a.m.
Apparently you cannot have both serializer: "JSON" show_errors: 1 in your config.yml. Enabling the automatic JSON serializer defeats the error screen, returning the exception error object as JSON to the client: { "exception" : "Text::Xslate: LoadError: Cannot find 'foo.tx' (path: /home/bla/qux) at /usr/lib/perl5/site_perl/5.8.8/Dancer/Template/Xslate.pm line 52.\n", "error" : "Text::Xslate: LoadError: Cannot find 'foo.tx' (path: /home/bla/qux) at /usr/lib/perl5/site_perl/5.8.8/Dancer/Template/Xslate.pm line 52.\n" } Is there a way I can fix this without going back to manual JSON encoding? (i.e. Setting content_type('application/json') and using to_json() on objects in route handlers.)