Re: Changing page-level error handler
Philip Semanchuk <[email protected]> Fri, 22 Dec 2006 10:49:56 -0500
| Newsgroups | gmane.comp.python.spyce.general |
|---|---|
| Message-ID | <[email protected]> |
On Dec 22, 2006, at 4:53 AM, Iwan Vosloo wrote: > Hi Philip, > > On Thu, 2006-12-21 at 14:34 -0500, Philip Semanchuk wrote: >> I also call Spyce programmatically in addition to using it to serve up >> dynamic Web pages, so I appreciate where you're coming from. However, >> I >> don't actually get what you're trying to do. Are you saying that some >> of your errors are recoverable and that you'd like to ignore them and >> have Spyce continue processing? > > No, I just want spyce NOT to handle the exception at all so that it > gets > propagated to the program calling spyce - which will then handle the > exception. If spyce catches the exception and renders a page all seems > OK to a calling program. > > Does that explain it? > >> My code for handling errors generated programmatically gets some >> detail >> about the error, records that data and then dumps processing to an >> "oops.html" file which basically says "Sorry, something went wrong". I >> understand that you don't want the output page, so couldn't you just >> use the same technique to execute whatever code you want and make >> oops.html a zero-byte file? > > I could try something like this, but I thought I can do it more > elegantly... Yes, now I understand, thanks for being patient. I agree that the available ways of communicating error status to the calling program are un-Pythonic. I have also considered this problem and I might try what Jonathan suggested about over-riding the server-level error handler. Up until now I have been solving this problem on a case-by-case basis. Sorry I wasn't more help. Philip ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV