@compforge/harness-toolbox 0.4.7 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,8 +19,10 @@ function describeOpenSearchError(error) {
|
|
|
19
19
|
seen.add(error);
|
|
20
20
|
const value = error;
|
|
21
21
|
const safe = (value2) => typeof value2 === "number" ? String(value2) : typeof value2 === "string" && /^[a-zA-Z0-9_.-]{1,80}$/.test(value2) ? value2 : undefined;
|
|
22
|
+
const argument = (value.code === "ERR_INVALID_ARG_VALUE" || value.code === "ERR_INVALID_ARG_TYPE") && typeof value.message === "string" ? value.message.match(/^The ["']([a-zA-Z][a-zA-Z0-9_.]{0,79})["'] (?:argument|option|property)/)?.[1] ?? value.message.match(/^The (?:argument|option|property) ["']([a-zA-Z][a-zA-Z0-9_.]{0,79})["']/)?.[1] : undefined;
|
|
22
23
|
parts.push([
|
|
23
24
|
`error=${safe(value.name) ?? "Error"}`,
|
|
25
|
+
argument && `argument=${argument}`,
|
|
24
26
|
safe(value.code) && `code=${safe(value.code)}`,
|
|
25
27
|
safe(value.kind) && `kind=${safe(value.kind)}`,
|
|
26
28
|
safe(value.statusCode ?? value.meta?.statusCode) && `status=${safe(value.statusCode ?? value.meta?.statusCode)}`
|
|
@@ -165,7 +167,9 @@ class OpenSearchClient {
|
|
|
165
167
|
await engine.ping(attempt.signal, attempt.remainingMs());
|
|
166
168
|
return { connection: engine, transport: transport.name };
|
|
167
169
|
} catch (error) {
|
|
168
|
-
|
|
170
|
+
try {
|
|
171
|
+
await engine.close();
|
|
172
|
+
} catch {}
|
|
169
173
|
throw error;
|
|
170
174
|
}
|
|
171
175
|
},
|
package/dist/opensearch/index.js
CHANGED