Hi all.

It looks like I've hit something which is already known (I've found this reference:


http://mail.zope.org/pipermail/zope-collector-monitor/2004-October/004316.html

)

I've a custom standard_error_html page, made with a Zope Page Template. I'm trying to provide a custom __str__ for a custom exception. This works, most of the time, but in some cases I encounter the following error:

TypeError: unbound method __str__() must be called with InvalidFolderId instance as first argument (got nothing instead)

InvalidFolderId is the custom exception, of course.

This is the code of the exception:

class InvalidFolderId(Exception):

    def __init__(self, folder_id):
        self.folder_id = folder_id

    def __str__(self):
return "folder id %s could not be found in the database" % self.folder_id


folder_id is a number. What could be done to avoid this problem?

Thank you in advance for the help.

Regards
Marco
begin:vcard
fn:Marco Bizzarri
n:Bizzarri;Marco
org:Icube S.r.l.
adr:;;via Ridolfi 15;Pisa;PI;56124;Italy
email;internet:[EMAIL PROTECTED]
title:Amministratore Delegato
tel;work:+39-050-970-207
tel;fax:+39-050-3136-588
tel;cell:+39-348-640-4861
x-mozilla-html:FALSE
url:http://notenotturne.blogspot.com/
version:2.1
end:vcard

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to