In BlueOcean RESTful API documentation, there contains a Error Message section that describes error details when something goes wrong.
{
"message" : "Failed to create Git pipeline: demo",
"code" : 400,
"errors" : [ {
"message" : "demo already exists",
"code" : "ALREADY_EXISTS",
"field" : "name"
} ]
}
But Jenkins Client don't include the JSON response into error detail or resolve the JSON response.
Therefore, the only feedback to invoker is unexpected status code: 400 instead of demo already exists.
At last, if we resolved this the error message responded by Blue Ocean API and append it into error, invoker would know what happended just now.
Originally posted by @JohnNiang in kubesphere/ks-devops#219 (comment)