Closed progrium closed 12 years ago
We should consider logging the exception instead of printing it. It will make debugging and testing easier.
Alan suggests we have two options: swallowing it or aborting (just die). Service.stop() should not raise. If it did, it's the Service implementor's fault.
Okay, we know that Service.stop() should not call Service.do_stop() if the service is not started, but should call stop() on its children.
We also decided to remove the try...except inside start() (and serve_forever()) that will try to call stop() on an exception.
I think the latest master satisfies this. I remember this was a nebulous issue that got into a bunch of other issues... most of which seem to have been resolved after 0.5.0
In Service.start() and .serve_forever() we catch all exceptions and call stop(). However, we added traceback.print_exc() so that if stop() raises, we can see the original exception. It seems like there is a better way to do this. Perhaps an inner try/except? Even though tests pass, we still get nasty, confusing output: