@dynatrace-sdk/http-client 1.0.7 → 1.0.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.
- package/CHANGELOG.md +9 -0
- package/cjs/index.js +6 -3
- package/docs/DOCS.md +1 -1
- package/esm/index.js +6 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/cjs/index.js
CHANGED
|
@@ -438,7 +438,8 @@ async function parseResponse(response) {
|
|
|
438
438
|
return {
|
|
439
439
|
message: getMessageFromObject(jsonBody.error) || getMessageFromObject(jsonBody) || consumedBody.substring(0, 100),
|
|
440
440
|
body: jsonBody,
|
|
441
|
-
errorRef: jsonBody.error?.details?.errorRef
|
|
441
|
+
errorRef: jsonBody.error?.details?.errorRef,
|
|
442
|
+
traceId: jsonBody.error?.details?.traceId
|
|
442
443
|
};
|
|
443
444
|
} else {
|
|
444
445
|
return {
|
|
@@ -456,8 +457,9 @@ async function parseResponse(response) {
|
|
|
456
457
|
var httpClientResponseErrorSerializer = async (error) => {
|
|
457
458
|
if (error instanceof HttpClientResponseError) {
|
|
458
459
|
const status = error.response.status;
|
|
459
|
-
const { message, body, errorRef } = await parseResponse(error.response);
|
|
460
|
+
const { message, body, errorRef, traceId } = await parseResponse(error.response);
|
|
460
461
|
const optionalErrorRef = errorRef ? { errorRef } : {};
|
|
462
|
+
const optionalTraceId = traceId ? { traceId } : {};
|
|
461
463
|
return {
|
|
462
464
|
name: error.name,
|
|
463
465
|
status,
|
|
@@ -465,7 +467,8 @@ var httpClientResponseErrorSerializer = async (error) => {
|
|
|
465
467
|
stack: error.stack,
|
|
466
468
|
type: import_error_handlers.ErrorType.HTTP,
|
|
467
469
|
body,
|
|
468
|
-
...optionalErrorRef
|
|
470
|
+
...optionalErrorRef,
|
|
471
|
+
...optionalTraceId
|
|
469
472
|
};
|
|
470
473
|
}
|
|
471
474
|
};
|
package/docs/DOCS.md
CHANGED
|
@@ -17,7 +17,7 @@ import NpmLogo from '@site/static/img/npm-logo.png';
|
|
|
17
17
|
</a>
|
|
18
18
|
</div>
|
|
19
19
|
<div class="col" style={{textAlign: 'right'}}>
|
|
20
|
-
<a href="https://www.npmjs.com/package/@dynatrace-sdk/http-client/v/1.0.
|
|
20
|
+
<a href="https://www.npmjs.com/package/@dynatrace-sdk/http-client/v/1.0.8">v1.0.8</a>
|
|
21
21
|
</div>
|
|
22
22
|
</div>
|
|
23
23
|
|
package/esm/index.js
CHANGED
|
@@ -406,7 +406,8 @@ async function parseResponse(response) {
|
|
|
406
406
|
return {
|
|
407
407
|
message: getMessageFromObject(jsonBody.error) || getMessageFromObject(jsonBody) || consumedBody.substring(0, 100),
|
|
408
408
|
body: jsonBody,
|
|
409
|
-
errorRef: jsonBody.error?.details?.errorRef
|
|
409
|
+
errorRef: jsonBody.error?.details?.errorRef,
|
|
410
|
+
traceId: jsonBody.error?.details?.traceId
|
|
410
411
|
};
|
|
411
412
|
} else {
|
|
412
413
|
return {
|
|
@@ -424,8 +425,9 @@ async function parseResponse(response) {
|
|
|
424
425
|
var httpClientResponseErrorSerializer = async (error) => {
|
|
425
426
|
if (error instanceof HttpClientResponseError) {
|
|
426
427
|
const status = error.response.status;
|
|
427
|
-
const { message, body, errorRef } = await parseResponse(error.response);
|
|
428
|
+
const { message, body, errorRef, traceId } = await parseResponse(error.response);
|
|
428
429
|
const optionalErrorRef = errorRef ? { errorRef } : {};
|
|
430
|
+
const optionalTraceId = traceId ? { traceId } : {};
|
|
429
431
|
return {
|
|
430
432
|
name: error.name,
|
|
431
433
|
status,
|
|
@@ -433,7 +435,8 @@ var httpClientResponseErrorSerializer = async (error) => {
|
|
|
433
435
|
stack: error.stack,
|
|
434
436
|
type: ErrorType.HTTP,
|
|
435
437
|
body,
|
|
436
|
-
...optionalErrorRef
|
|
438
|
+
...optionalErrorRef,
|
|
439
|
+
...optionalTraceId
|
|
437
440
|
};
|
|
438
441
|
}
|
|
439
442
|
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynatrace-sdk/http-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "An environment agnostic (browser/deno vs nodejs) abstraction layer for making HTTP calls.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynatrace-sdk/error-handlers": "^1.
|
|
7
|
+
"@dynatrace-sdk/error-handlers": "^1.2.0"
|
|
8
8
|
},
|
|
9
9
|
"main": "./cjs/index.js",
|
|
10
10
|
"module": "./esm/index.js",
|