Handle exception in processor

34 views
Skip to first unread message

Sébastien Auvray

unread,
Mar 25, 2012, 9:31:58 AM3/25/12
to we...@googlegroups.com
Hi all,

I'm developing an app using web.py which renders an XML tree (something like xslt).
I validate the document against an xsd in most GET requests.
To avoid catching this kind of exception in every GET method, I added a processor which looks like :

def validate_xml(handler):
  try:
    return handler()
  except MyXmlException as e:
    return render.document_error(e)

but the exception is never caught in my processor, but at upper level by app itself.

Any idea to get the exception caught in my handler ??

Thanx a lot,

Seb.
Reply all
Reply to author
Forward
0 new messages