Repository: yetus Updated Branches: refs/heads/master 4315582d4 -> 8343bd0fe
YETUS-536 Jira plugin should output the information about curl failure in debug mode. Signed-off-by: Allen Wittenauer <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/8343bd0f Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/8343bd0f Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/8343bd0f Branch: refs/heads/master Commit: 8343bd0fe6f9ea14461076a57b21e6d857aad3f0 Parents: 4315582 Author: Mano Kovacs <[email protected]> Authored: Fri Aug 18 12:08:57 2017 +0200 Committer: Allen Wittenauer <[email protected]> Committed: Wed Sep 20 09:48:12 2017 -0700 ---------------------------------------------------------------------- precommit/test-patch.d/jira.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/8343bd0f/precommit/test-patch.d/jira.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/jira.sh b/precommit/test-patch.d/jira.sh index cce82a0..eedb1ff 100755 --- a/precommit/test-patch.d/jira.sh +++ b/precommit/test-patch.d/jira.sh @@ -97,6 +97,7 @@ function jira_http_fetch { declare input=$1 declare output=$2 + declare ec yetus_debug "jira_http_fetch: ${JIRA_URL}/${input}" if [[ -n "${JIRA_USER}" @@ -112,6 +113,27 @@ function jira_http_fetch --location \ "${JIRA_URL}/${input}" fi + ec=$? + case "${ec}" in + "0") + ;; + "1") + yetus_debug "jira_http_fetch: Unsupported protocol. Maybe misspelled jira's url?" + ;; + "3") + yetus_debug "jira_http_fetch: ${JIRA_URL}/${input} url is malformed." + ;; + "6") + yetus_debug "jira_http_fetch: Could not resolve host in URL ${JIRA_URL}." + ;; + "22") + yetus_debug "jira_http_fetch: ${JIRA_URL}/${input} returned 4xx status code. Maybe incorrect username/password?" + ;; + *) + yetus_debug "jira_http_fetch: ${JIRA_URL}/${input} returned $ec error code. See https://ec.haxx.se/usingcurl-returns.html for details." + ;; + esac + return ${ec} } function jira_locate_patch
