From: Frank Brehm Date: Mon, 9 Mar 2020 13:14:21 +0000 (+0100) Subject: Better error handling in lib/cr_tf/handler.py X-Git-Tag: 1.4.6~2^2 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=40501b596d63ad0528a3c7bc7e3a2f68c3e4f87d;p=pixelpark%2Fcreate-terraform.git Better error handling in lib/cr_tf/handler.py --- diff --git a/lib/cr_tf/handler.py b/lib/cr_tf/handler.py index 7c31a7d..20a44c3 100644 --- a/lib/cr_tf/handler.py +++ b/lib/cr_tf/handler.py @@ -60,7 +60,7 @@ from .terraform.disk import TerraformDisk from .xlate import XLATOR -__version__ = '3.4.3' +__version__ = '3.4.4' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -377,8 +377,9 @@ class CreateTerraformHandler(BaseHandler): try: api_version = self.pdns.get_api_server_version() # noqa - except PowerDNSHandlerError as e: - raise ExpectedHandlerError(str(e)) + except (PowerDNSHandlerError, ConnectionError) as e: + msg = "{c}: {e}".format(c=e.__class__.__name__, e=str(e)) + raise ExpectedHandlerError(msg) # ------------------------------------------------------------------------- def check_terraform_version(self):