question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JobsApi.build() error messages are not reported

See original GitHub issue

Expected 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:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
martindacommented, May 11, 2018

I am attempting an implementation of IntegerResponse on this branch. I am not done, three tests are failing and I am debugging.

1reaction
martindacommented, May 10, 2018

Can you explain the difference you are making between a ResponseWrapper and an IntegerResponse, for example you say that IntegerResponse would be more generic than ResponseWrapper, what do you mean by that (I would have thought the other way around)?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found