← Back to team overview

python-jenkins-developers team mailing list archive

[Bug 1246468] Re: Jenkins returning 404 cannot be distinguished

 

What I'm trying to say, probably not very clearly, is that when I use
the Jenkins CANCEL_QUEUE REST endpoint I always get a 404 error. I don't
know why but that's what jenkins is giving me.  Your implementation
above raises a  NotFoundException on a 404 so I would get an exception
every time i make a call to cancel_queue() wether I pass in a valid ID
or not.  So in this case how do I determine wether there's a failure or
not?

I think you may be correct that 404 is returned for jobs that don't
exist, but I assume that you would use the JOB_NAME endpoint for that
therefore I think raising an exception for 404 may work for some
endpoints but not for all.

It might be  more clear and more productive if you push a patch to
gerrit suggesting your change for this fix then we can discuss the
patch.

-- 
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:
  Incomplete

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