python-jenkins-developers team mailing list archive
-
python-jenkins-developers team
-
Mailing list archive
-
Message #00190
[Bug 1246468] Re: Jenkins returning 404 cannot be distinguished
Reviewed: https://review.openstack.org/139158
Committed: https://git.openstack.org/cgit/stackforge/python-jenkins/commit/?id=8c3e979810ce8b0256465e9a8fe373d8d9832859
Submitter: Jenkins
Branch: master
commit 8c3e979810ce8b0256465e9a8fe373d8d9832859
Author: Kevin L. Mitchell <kevin.mitchell@xxxxxxxxxxxxx>
Date: Tue Jan 13 16:38:15 2015 -0600
Raise an exception on 404
Currently, when Jenkins returns a 404 error, the jenkins_open()
method gives no indication. This adds a new NotFoundException,
descending from JenkinsException, which can be used to distinguish
this case. This causes a problem with cancel_queue(), however,
as the Jenkins API always returns a 404; since cancel_queue() is
a best-effort mechanism, this change also modifies that method to
explicitly ignore a NotFoundException. The maybe_add_crumb()
method also has to be updated to properly handle 404s, for the
case where crumbs are disabled. The get_job_name() method is also
adjusted to return None if jenkins_open() raises a NotFoundException.
A few quick google searches shows that only the cancelItem
endpoint will always return 404.
Change-Id: I98320d174659fc83d48614b31a5a054fd0773dfe
Closes-Bug: #1246468
** Changed in: python-jenkins
Status: In Progress => Fix Committed
--
You received this bug notification because you are a member of Python
Jenkins Developers, which is subscribed to Python Jenkins.
https://bugs.launchpad.net/bugs/1246468
Title:
Jenkins returning 404 cannot be distinguished
Status in Python API for Jenkins:
Fix Committed
Bug description:
If a non-GET request is made for a resource which doesn't exist—such
as cancelling a non-existant queue item—no exception or error is
reported to the user. At the very least, a distinguishable error
should be raised. (Distinguishable in that it should not be
JenkinsException, although it should be a subclass of
JenkinsException).
To manage notifications about this bug go to:
https://bugs.launchpad.net/python-jenkins/+bug/1246468/+subscriptions
References