@elastic/elasticsearch-canary
Advanced tools
Comparing version 7.13.0-canary.4 to 7.13.0-canary.5
@@ -93,3 +93,11 @@ /* | ||
this.name = 'ResponseError' | ||
this.message = (meta.body && meta.body.error && meta.body.error.type) || 'Response Error' | ||
if (meta.body && meta.body.error && meta.body.status) { | ||
if (Array.isArray(meta.body.error.root_cause)) { | ||
this.message = meta.body.error.root_cause.map(entry => `[${entry.type}] Reason: ${entry.reason}`).join('; ') | ||
} else { | ||
this.message = 'Response Error' | ||
} | ||
} else { | ||
this.message = 'Response Error' | ||
} | ||
this.meta = meta | ||
@@ -112,2 +120,6 @@ } | ||
} | ||
toString () { | ||
return JSON.stringify(this.meta.body) | ||
} | ||
} | ||
@@ -114,0 +126,0 @@ |
@@ -309,4 +309,4 @@ /* | ||
} else { | ||
// cast to boolean if the request method was HEAD | ||
result.body = isHead === true ? true : payload | ||
// cast to boolean if the request method was HEAD and there was no error | ||
result.body = isHead === true && result.statusCode < 400 ? true : payload | ||
} | ||
@@ -313,0 +313,0 @@ |
@@ -14,4 +14,4 @@ { | ||
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html", | ||
"version": "7.13.0-canary.4", | ||
"versionCanary": "7.13.0-canary.4", | ||
"version": "7.13.0-canary.5", | ||
"versionCanary": "7.13.0-canary.5", | ||
"keywords": [ | ||
@@ -108,3 +108,3 @@ "elasticsearch", | ||
}, | ||
"commitHash": "d3d940d1" | ||
"commitHash": "a3344aa1" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1806243
102
33536