Sandro Bonazzola has posted comments on this change. Change subject: error handling: Provide more informative error messages ......................................................................
Patch Set 6: Code-Review+1 (1 comment) A comment inline. Please verify the patch. https://gerrit.ovirt.org/#/c/36929/6/src/__main__.py File src/__main__.py: Line 524: url=url, Line 525: ) Line 526: ) Line 527: return False Line 528: except RequestError as re: Maybe you can use something like a global dict like: REQ_ERRORS = { 401:_("...."), ..., } GENERIC_REQ_ERROR=_(....) and then here just use REQ_ERRORS.get(re.status, GENERIC_REQ_ERROR) Same for ConnectionError. No strong feelings about it anyway. Line 529: if re.status == 401: Line 530: logging.error( Line 531: _( Line 532: "Unable to connect to REST API at {url}\n" -- To view, visit https://gerrit.ovirt.org/36929 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I969f75ce9402df4b42f45c7293266bf60acc59e3 Gerrit-PatchSet: 6 Gerrit-Project: ovirt-iso-uploader Gerrit-Branch: master Gerrit-Owner: Jake Hunsaker <[email protected]> Gerrit-Reviewer: James W. Mills <[email protected]> Gerrit-Reviewer: Sandro Bonazzola <[email protected]> Gerrit-Reviewer: Simone Tiraboschi <[email protected]> Gerrit-Reviewer: Yedidyah Bar David <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
