Hi,
Sean Woods wrote:
> My code raises an AttributeError: 'RequestRedirect' object has no
> attribute 'find'
A RequestRedirect is an HTTPException and as such a WSGI application.
You can now either access `error.new_url` which is the new URL where you
want to redirect to, or return the `error` as response from the
application or just handle the RequestRedirect with an HTTPException
handler:
try:
endpoint, args = urls.match()
...
except NotFound, e:
response.data = 'Not Found!'
response.status_code = 404
except HTTPException, e:
response = e # catches the RedirectException too
return response(environ, start_response)
Regards,
Armin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pocoo-libs?hl=en
-~----------~----~----~----~------~----~------~--~---