On Tuesday 12 February 2002 11:51 pm, Chuck Esterbrook wrote: > On Tuesday 12 February 2002 01:39 pm, Clark C . Evans wrote: > > Hello. I was wondering what incantation I need so that > > my servlet's "sleep()" function is called whenever a > > error is thrown? > > > > Thanks! > > In pre-CVS WebKit you could do something like: > > def writeHTML(self): > try: > Page.writeHTML(self) > finally: > if not self.slept: > self.sleep(self.transaction()) > > > (I haven't tested this.) > > Obviously, your awake() will set slept to 0 and sleep() will set it > to 1 and also do a no-op if it is already 1. The try:finally: is > probably overkill as sleep() should not be invoked when writeHTML() > is finished.
Woops. The try:finally: is quite necessary given the problem you are trying to solve. What I meant to say was that the "if not self.slept:" is probably overkill. -Chuck _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss