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: I7b7201b23adbb0ee7c452f9a936644b2b7b52ac4 Bug-Url: https://bugzilla.redhat.com/1144836 Signed-off-by: Simone Tiraboschi <stira...@redhat.com> --- M src/__main__.py 1 file changed, 32 insertions(+), 11 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-image-uploader refs/changes/62/33262/1 diff --git a/src/__main__.py b/src/__main__.py index c75f8e7..29cc7cf 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -489,36 +489,57 @@ 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_e: + except RequestError as re_e: logging.error( - _("Unable to connect to REST API. Reason: %s"), - re_e.reason + _( + "Unable to connect to REST API at {url}\n" + "Reason: {reason}" + ).format( + url=url, + reason=re_e.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/33262 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7b7201b23adbb0ee7c452f9a936644b2b7b52ac4 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-image-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