lib/api/util.js
function htmlError(result, cb) {
  var message = result.body
    .match(/<h1>Error<\/h1>.+<\/p>/).toString()
    .replace(/<h1>Error<\/h1>/, '')
    .replace(/<\/?p>/g, '');
  cb(new Error(message));
}
function htmlError(result, cb) {
  var message = result.body
    .match(/<h1>Error<\/h1>.+<\/p>/).toString()
    .replace(/<h1>Error<\/h1>/, '')
    .replace(/<\/?p>/g, '');
  cb(new Error(message));
}
function htmlError ( result , cb ) { var message = result . body . match ( / <h1>Error<\/h1>.+<\/p> / ) . toString ( ) . replace ( / <h1>Error<\/h1> / , '' ) . replace ( / <\/?p> / g , '' ) ; cb ( new Error ( message ) ) ; }
Parse HTML error page from Jenkins, pass the error message to the callback.
This error is usually the response body of error 400.

@param {Object} result: result of the sent request
@param {Function} cb: standard cb(err, result) callback
Parse HTML error page from Jenkins pass the error message to the callback . This error is usually the response body of error 400 .