On Thu, 13 Mar 2014 18:57:04 -0600
Warren Young <[email protected]> wrote:
> 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:
<snip>
You could argue that's correct and desired behaviour - if you have set
serialiser: "JSON", you are, presumably, writing an API, which will be
used by API consumers expecting JSON. Suddenly dumping a HTML error
page at them instead of the JSON they were expecting would be silly and
wrong - returning JSON describing the error seems much more sane.
So, I wouldn't say it breaks the error page, I'd say it's logical
behaviour.
If you don't want it, though, you could probably get round it with
Yanick's suggestion of using before_serializer.
--
David Precious ("bigpresh") <[email protected]>
http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter
www.preshweb.co.uk/linkedin www.preshweb.co.uk/facebook
www.preshweb.co.uk/cpan www.preshweb.co.uk/github
_______________________________________________
dancer-users mailing list
[email protected]
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users