R
Robert Brewer
I don't have a quesiton or problem, I just figured some of you would
enjoy the somewhat bizarre logic of the snippet I just wrote for a CGI
request dispatcher:
try:
return nextHandler(args)
except (None, Exception)[self.trapErrors], exc:
if page == u'-Error':
raise exc
else:
return self.handle_error(exc, scriptWithPath)
If self.trapErrors is True, all exceptions (which subclass Exception)
get trapped, otherwise, no exceptions are trapped. Spiffy.
FuManChu
enjoy the somewhat bizarre logic of the snippet I just wrote for a CGI
request dispatcher:
try:
return nextHandler(args)
except (None, Exception)[self.trapErrors], exc:
if page == u'-Error':
raise exc
else:
return self.handle_error(exc, scriptWithPath)
If self.trapErrors is True, all exceptions (which subclass Exception)
get trapped, otherwise, no exceptions are trapped. Spiffy.
FuManChu