Cool!
The third option worked, however I placed the code into my Root class
instead of creating an ErrorCatcher Class.
The only thing that didn't work at first was this definition:
def __init__(self, *args, **kw):
super(ErrorCatcher, self).__init__(*args, **kw)
self.sender_email = config.get('error_catcher.sender_email')
self.admin_email = config.get('error_catcher.admin_email')
self.smtp_host = config.get('error_catcher.smtp_host',
'localhost')
self.smtp_user = config.get('error_catcher.smtp_user')
self.smtp_passwd = config.get('error_catcher.smtp_passwd')
I think because I needed to change super(ErrorCatcher, self) etc. to
super(Root,self) etc.
And other than adjusting the location of my custom templates:
_error_templates = {
None: 'toolkit.templates.error',
404: 'toolkit.templates.notfound',
500: 'toolkit.templates.error',
}
I literally was able to pretty much cut and paste the code. Wow!
Cool!!
Thanks again for your help.
-Steve
On Mar 23, 9:52 am, "Steve" <[EMAIL PROTECTED]> wrote:
> Thanks, Chris.
>
> I'll give the third option a go. I don't think I want to email
> anything at this point, but let me sift through and see if I can can
> this to work. I'll post my results.
>
> Thanks again for the input!
>
> -Steve
>
> On Mar 23, 8:58 am, Christopher Arndt <[EMAIL PROTECTED]> wrote:
>
> > Steve schrieb:
>
> > > Hello,
>
> > > I've done some research in this group and the CherryPy group and came
> > > up with a way to point CherryPy to custom 404 and 500 error pages.
> > > The discussions I found were fairly old and some of the links to
> > > suggestions no longer work, so I wanted to put this out there and make
> > > sure I wasn't missing anything.
>
> > Have you readhttp://docs.turbogears.org/1.0/ErrorReporting(serveris down
> > atm, try this mirror [1] instead)?
>
> > The third solution on this page has code for a drop-in root-controller base
> > class, that not-only allows custom templates for different errors but also
> > does
> > email notification.
>
> > Chris
>
> > [1]http://tinyurl.com/2llhy6
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---