2013/10/9 Valentin v. Seggern <notifications@github.com>
> In src/com/crowflying/buildwatch/jenkins/JenkinsRetrievalCommand.java:
> > @@ -69,8 +77,13 @@ protected Response connectToJenkins() throws IOException {
> >   String.format("Got back HTTP %s: %s",
> >   connection.getResponseCode(),
> >   connection.getResponseMessage()));
> > - return new Response(connection.getResponseCode(),
> > - connection.getInputStream());
> > + try {
> > + resp = new Response(connection.getResponseCode(),
> > +                        connection.getInputStream());
> > + } catch (IOException ie) {
> Out of curiosity, why did you change the exception handling here. I feel that this might screw up some of the error handling in the UI, but I have not tested this yet.

connection.getInputStream() throws an IOException if the HTTP response
was an error (probably status code 400 or above, but haven't checked
the actual implementation). This meant that when I called
GetCrumbInfoCommand().execute() against a Jenkins instance without
CSRF protection, the HTTP 404 returned from the crumbIssuer caused the
processing to fail right there. Additionally, the fact that the
Response class has an isFailiure method indicated that the intention
actually was to create the Response object and pass it to the
JenkinsRetrievalCommand subclass's parseResponse method.