contrib
contrib copied to clipboard
contrib/jenkins/jenkins_ Add better error message in case of not authorized response from server
I am currently using version 7c62b9b6deb8191889ba817df10005366524fa8b of the jenkins plugin.
When providing a not working API token, I expected something like:
Not authorized. Provided API token username combination is not working.
Received response for each three modes of the plugin is the following:
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "(end of string)") at /etc/munin/plugins/jenkins_running line 200.
When executing the wget call that is performed by the plugin without -q0-
, I received the following error message:
HTTP request sent, awaiting response... 401 Invalid password/token for user: MySecretJenkinsUser
Authorization failed.
So, maybe it is possible to check for the HTTP response code or something else before passing it to the JSON decoder.
Stale issue message