Re: How to not return ticket issue HTML but a custom error?

29 views
Skip to first unread message

Anthony

unread,
Sep 20, 2016, 5:20:04 PM9/20/16
to web2py-users, web2py-developers
On Tuesday, September 20, 2016 at 12:20:48 PM UTC-4, Ty oc wrote:
Well also now I got it (still not per app)... but the problem Im having is that I want to return a json, but Im getting the full HTML response  with a body and all that.

If I use

error_handler = dict(application='backend',
controller='error',
function='report')

Nothing changes. So I have setup

Yes, it seems the documentation is way off regarding error_handler. As far as I can tell, the only time that does anything is when you request a non-existent application, in which case, it does a full HTTP redirect to the application specified in error_handler, with the name of the originally requested application in request.args(0). Given its functionality, it would be better named something like missing_app_handler.

Anthony
Reply all
Reply to author
Forward
0 new messages