From: JINMEI Tatuya Date: Mon, 31 Dec 2012 22:23:28 +0000 (-0800) Subject: [711] reraise original exception when failed() fails in component.start() X-Git-Tag: bind10-1.0.0-rc-release~99^2~22^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b722ec0d7813e933db3919df492dccf11a3b4eb;p=thirdparty%2Fkea.git [711] reraise original exception when failed() fails in component.start() see the code comment for the rationale. --- diff --git a/src/lib/python/isc/bind10/component.py b/src/lib/python/isc/bind10/component.py index 1f7006cb57..febeb10337 100644 --- a/src/lib/python/isc/bind10/component.py +++ b/src/lib/python/isc/bind10/component.py @@ -177,8 +177,14 @@ class BaseComponent: self._start_internal() except Exception as e: logger.error(BIND10_COMPONENT_START_EXCEPTION, self.name(), e) - self.failed(None) - raise + try: + self.failed(None) + finally: + # Even failed() can fail if this happens during initial startup + # time. In that case we'd rather propagate the original reason + # for the failure than the fact that failed() failed. So we + # always re-raise the original exception. + raise e def stop(self): """