Merge branch '7.x' of https://github.com/elastic/elasticsearch-js into 7.x
This commit is contained in:
@ -90,7 +90,7 @@ class ResponseError extends ElasticsearchClientError {
|
||||
super('Response Error')
|
||||
Error.captureStackTrace(this, ResponseError)
|
||||
this.name = 'ResponseError'
|
||||
if (meta.body && meta.body.error && meta.body.status) {
|
||||
if (meta.body && meta.body.error && meta.body.error.type) {
|
||||
if (Array.isArray(meta.body.error.root_cause)) {
|
||||
this.message = meta.body.error.type + ': '
|
||||
this.message += meta.body.error.root_cause.map(entry => `[${entry.type}] Reason: ${entry.reason}`).join('; ')
|
||||
|
||||
Reference in New Issue
Block a user