Hello,
I want to write a generic error handler which will display meaningful page
to the user in case some particular error occurs.
I have tried to override WSGIController.__call__ using the following code
but it doesn't work:
try:
return WSGIController.__call__(self, environ, start_response)
except model.SQLError, e:
c.message = e
c.code = 500
return render('/custom_error.html')
When executed it simply prints a traceback to stderr:
File
"/usr/lib/python2.5/site-packages/Paste-1.4-py2.5.egg/paste/httpserver.py",
line 287, in wsgi_execute
self.wsgi_start_response)
File
"/usr/lib/python2.5/site-packages/Paste-1.4-py2.5.egg/paste/translogger.py",
line 67, in __call__
return self.application(environ, replacement_start_response)
File
"/usr/lib/python2.5/site-packages/Paste-1.4-py2.5.egg/paste/debug/prints.py",
line 98, in __call__
environ, self.app)
File "/usr/lib/python2.5/site-packages/Paste-1.4-py2.5.egg/paste/wsgilib.py",
line 540, in intercept_output
if data[0] is None:
IndexError: list index out of range
How do I do this properly?
--
Max Ischenko
http://www.developers.org.ua/ -- Ukrainian software developers community
http://maxischenko.in.ua/ -- my blog (Russian)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---