Product AttributeError __error_log__ ???
I can't seem to debug my product on Zope 2.6. Product subclasses simple item and my own classes. Every Error produces the following informative output. About as informative as most WinDZ errors :) Any Clues Site Error An error was encountered while publishing this resource. exceptions.AttributeError Sorry, a site error occurred. Traceback (innermost last): Module ZPublisher.Publish, line 150, in publish_module Module ZPublisher.Publish, line 114, in publish Module Zope, line 134, in zpublisher_exception_hook AttributeError: __error_log__ Troubleshooting Suggestions The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience.
For some reason you are missing the error_log object in the root folder. If it is there, try to delete and recreate it. HTH, Stefan --On Mittwoch, 04. Dezember 2002 11:26 +0100 chrisf <chrisf@fagmed.uit.no> wrote:
I can't seem to debug my product on Zope 2.6. Product subclasses simple item and my own classes. Every Error produces the following informative output. About as informative as most WinDZ errors :) Any Clues
Site Error
An error was encountered while publishing this resource.
exceptions.AttributeError
Sorry, a site error occurred.
Traceback (innermost last):
Module ZPublisher.Publish, line 150, in publish_module Module ZPublisher.Publish, line 114, in publish Module Zope, line 134, in zpublisher_exception_hook
AttributeError: __error_log__
Troubleshooting Suggestions
The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error.
For more detailed information about the error, please refer to the HTML source for this page.
If the error persists please contact the site maintainer. Thank you for your patience.
-- Those who write software only for pay should go hurt some other field. /Erik Naggum/
If you use a siteroot you need a new error_log...
I have an error_log and a no site_root. DTML and other exceptions are registered, but not from my python product. Do I need to inherit from a special 'logger class' Chris
--On Mittwoch, 04. Dezember 2002 11:39 +0100 chrisf <chrisf@fagmed.uit.no> wrote:
I have an error_log and a no site_root. DTML and other exceptions are registered, but not from my python product. Do I need to inherit from a special 'logger class'
No, but you must make sure the app object can be acquired. Line 134 of module Zope is: log = aq_acquire(published, '__error_log__', containment=1) Either you have to _setObject() you object or wrap it manually. Stefan -- Those who write software only for pay should go hurt some other field. /Erik Naggum/
"Stefan H. Holek" wrote:
No, but you must make sure the app object can be acquired.
Line 134 of module Zope is:
log = aq_acquire(published, '__error_log__', containment=1)
Either you have to _setObject() you object or wrap it manually.
I noticed the code as well, too bad. I DON'T want to inherit from aquire. This should not be a requirement for basic functionality, such as error checking !!! Have we forgotten good OO design paradigms ??? My classes are numerous, some are generated on the fly, and none are registered as products. Each class exists in a hash under of the one registered product 'Family Dispatcher' that intercepts the http request, splits it, and recusively searches through the children hash of objects for attributes(methods), or returns error. Each class does inherit from persistence of course. If interested the code is quite small: def __bobo_traverse__(self,REQUEST=None,NAME=None): return self def __call__(self,REQUEST): url = REQUEST.URLPATH0.split('/') url = url[url.index(self.id)+1:] if 'white' in url: url.remove('white') # a wierd zope thing return self.__find__(url,obj=None,REQUEST=REQUEST) def __find__(self,url,obj=None,REQUEST=None): if obj is None: obj=self i = url[0] if hasattr(obj, i) : return getattr(obj,i)(REQUEST) if obj.children.has_key(i): return self.__find__(url=url[1:],obj=obj.children[i],REQUEST=REQUEST) else : return 'error'
participants (3)
-
chrisf -
Harald Winkelmann -
Stefan H. Holek