Re: Changing page-level error handler

Iwan Vosloo <[email protected]> Thu, 21 Dec 2006 07:54:29 +0200
Newsgroups gmane.comp.python.spyce.general
Message-ID <[email protected]>
Hi Philip,

On Wed, 2006-12-20 at 10:35 -0500, Philip Semanchuk wrote:
> On Dec 20, 2006, at 7:57 AM, Iwan Vosloo wrote:
> Hi Ivan,
> In my spyceconf.py, I have this comment --
> 
> # The pageerror option sets the default page-level error handler.
> # "Page-level" means all runtime errors that occur during the
> # processing of a Spyce script (i.e. after the compilation phase has
> # completed successfully)
> #
> # The format of this option is one of:
> #   ('string', 'MODULE', 'VARIABLE')
> #   ('file', 'URL')
> # (This format is used since the error template must be transformed into
> # compiled spyce code, which can't be done before the configuration file
> # is completely loaded.)
> #
> # Please refer to the default template to see how to define your own
> # page-level error handlers.
> 
> 
> And this bit of code works for me:
> pageerrortemplate = ('string', 'TheModuleName', 'TheFunctionName')
> 

Yes, that comment (except for the very first line, which refers to
"pageerror") applies to "pageerrortemplate" - as you use it.  

My (probably erroneous) understanding from what I've read is that there
is an error handling _function_ also, and that the default one renders
"pageerrortemplate".  

But I don't want it to render any templates at all, I want it just to
call my own function...  I call spyce programmatically from another
program, and would rather catch an exception myself, rather than have
spyce render an error page.  This is the behaviour I'm trying to
change...

Do I have it wrong? 

-i


-------------------------------------------------------------------------
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