Merge branch 'master' into 6.x

This commit is contained in:
delvedor
2019-03-26 12:08:00 +01:00
271 changed files with 2472 additions and 2756 deletions

View File

@ -24,7 +24,7 @@
function buildCatRepositories (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.repositories](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html) request
*
@ -81,18 +81,14 @@ function buildCatRepositories (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null