what do i need to return at an error handler controller to get the same as
web2py does by default? Let me ellaborate:
I have implemented "routes on error" at routes.py like:
routes_onerror = [
(r"*/*", r"/error")
]
so any error goes through "/myapp/controllers/error.py" (note i have
removed the appname from any route, thats not the issue).
on errors.py i have some code for development only: (skip the tickets
system)
def index():
import mechanize
url = "http://127.0.0.1/admin/default/ticket/" + request.vars.ticket
br = mechanize.Browser()
br.set_handle_robots(False)
resp = br.open(url)
br.form = list(br.forms())[0]
br.form['password'] = "1234"
req = br.submit()
return req.read()
If i write this on a random controller:
raise HTTP(400, "cant do it")
i would like that response to get to the browser instead the one at
errors.py so:
what do i need to return at errors.py so i get this 400 error with the
message?
In other words, what would i need to return to get the same result as if
routes on error wasnt implemented in the first place (web2py's default
error dispatching)
Thanks.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.