Simone Tiraboschi has uploaded a new change for review.

Change subject: packaging: setup: Making error messages more verbose
......................................................................

packaging: setup: Making error messages more verbose

Making error messages a bit more verbose to help the user
pointing out possible problems.

Change-Id: I0a722d37420f4a3c9b0af09dc483cc9d73b4faff
Bug-Url: https://bugzilla.redhat.com/1144836
Signed-off-by: Simone Tiraboschi <stira...@redhat.com>
---
M src/__main__.py
1 file changed, 29 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-iso-uploader 
refs/changes/63/33263/1

diff --git a/src/__main__.py b/src/__main__.py
index d10b49f..d45074b 100644
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -519,36 +519,54 @@
                         vrm
                     )
                 else:
-                    logging.error(_("Unable to connect to REST API."))
+                    logging.error(
+                        _("Unable to connect to REST API at {url}").format(
+                            url=url,
+                        )
+                    )
                     return False
-            except RequestError, re:
+            except RequestError as re:
                 logging.error(
-                    _("Unable to connect to REST API.  Reason: %s"),
-                    re.reason
+                    _(
+                        "Unable to connect to REST API at {url}\n"
+                        "Reason: {reason}"
+                    ).format(
+                        url=url,
+                        reason=re.reason,
+                    ),
                 )
                 return False
             except ConnectionError:
                 logging.error(
                     _(
-                        "Problem connecting to the REST API.  Is the "
-                        "service available and does the CA certificate "
+                        "Problem connecting to the REST API at {url}\n"
+                        "Is the service available and does the CA certificate "
                         "exist?"
+                    ).format(
+                        url=url,
                     )
                 )
                 return False
             except NoCertificatesError:
                 logging.error(
                     _(
-                        "Problem connecting to the REST API.  The CA is "
-                        "invalid.  To override use the \'insecure\' "
+                        "Problem connecting to the REST API at {url}\n"
+                        "The CA is invalid. To override use the \'insecure\' "
                         "option."
+                    ).format(
+                        url=url,
                     )
                 )
                 return False
-            except Exception, e:
+            except Exception as e:
                 logging.error(
-                    _("Unable to connect to REST API.  Message: %s"),
-                    e
+                    _(
+                        "Unable to connect to REST API at {url}\n"
+                        "Message: {e}"
+                    ).format(
+                        url=url,
+                        e=e,
+                    )
                 )
                 return False
         return True


-- 
To view, visit http://gerrit.ovirt.org/33263
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a722d37420f4a3c9b0af09dc483cc9d73b4faff
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-iso-uploader
Gerrit-Branch: master
Gerrit-Owner: Simone Tiraboschi <stira...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to