]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Better error handling in lib/cr_tf/handler.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 9 Mar 2020 13:14:21 +0000 (14:14 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 9 Mar 2020 13:14:21 +0000 (14:14 +0100)
lib/cr_tf/handler.py

index 7c31a7d96142f5ed921e3559bd8a708a4ff32ec6..20a44c3c129ad196b6ca621ead371831b6b8e1c9 100644 (file)
@@ -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):