[Backport 7.x] Show the body as string if the response error can't be read as ES error (#1514)

* Show the body as string if the response error can't be read as ES error

* Updated test

Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2021-08-11 09:46:37 +02:00
committed by GitHub
parent a48ebc9442
commit 559acd32be
4 changed files with 60 additions and 3 deletions

View File

@ -649,7 +649,7 @@ test('500 error', t => {
}
}
}, (err, result) => {
t.equal(err.message, 'Response Error')
t.equal(err.message, '{"error":"kaboom"}')
client.search({
index: 'foo',