JobsApi.build() error messages are not reported
See original GitHub issueExpected Behavior
When launching a build with an invalid build name, errors reported by Jenkins should be passed along to the caller.
Current Behavior
When launching a build with an invalid build name, a null Integer is returned.
Context
When an invalid build name is passed, there is no indication as to what was wrong other than null being returned. This forces users to setup logging and re-run the program, something most end users find difficult to do and/or too costly.
As suggested in comment https://github.com/cdancy/jenkins-rest/issues/14#issuecomment-387248721 it probably makes sense to return a RequestStatus response rather than a plain integer.
Steps to Reproduce (for bugs)
The following groovy code reproduces the problem:
@Grab(group='com.cdancy', module='jenkins-rest', version='0.0.8')
import com.cdancy.jenkins.rest.JenkinsClient
JenkinsClient client = JenkinsClient.builder().build()
println(client.api().jobsApi().build("non-existent"))
It will print: null
and there is no error message.
Your Environment
Linux command line.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
cdancy/jenkins-rest - Crumb issuer errors are not reported
A null Integer is returned by client.api().jobsApi().build(buildName) . Context. Application fails without a meaningful error message, making it ...
Read more >Jobs API 2.1 | Databricks on AWS
The Jobs API allows you to create, edit, and delete jobs. You should never hard code ... The request was not handled correctly...
Read more >Jobs API - GitLab Docs
List project jobs. Get a list of jobs in a project. Jobs are sorted in descending order of their IDs. By default, this...
Read more >Xcode: Build Failed, but no error messages - Stack Overflow
It never happened while I was writing in Objective C . There were no any logs in Report Navigator too. Project just compiled...
Read more >Error messages | BigQuery - Google Cloud
Error message HTTP code Description
stopped 200 This status code returns when a job is canceled.
timeout 400 The job timed out.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am attempting an implementation of
IntegerResponse
on this branch. I am not done, three tests are failing and I am debugging.Can you explain the difference you are making between a
ResponseWrapper
and anIntegerResponse
, for example you say thatIntegerResponse
would be more generic thanResponseWrapper
, what do you mean by that (I would have thought the other way around)?