@aws-sdk/core
Advanced tools
@@ -56,3 +56,3 @@ import { RpcProtocol } from "@smithy/core/protocols"; | ||
| } | ||
| const errorIdentifier = loadJsonRpcErrorCode(response, dataObject, this.getJsonRpcVersion() === "1.1", awsQueryCompatible) ?? "Unknown"; | ||
| const errorIdentifier = loadJsonRpcErrorCode(response, dataObject, awsQueryCompatible) ?? "Unknown"; | ||
| this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace); | ||
@@ -59,0 +59,0 @@ const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined); |
@@ -24,3 +24,3 @@ import { collectBodyString } from "../common"; | ||
| const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); | ||
| const sanitizeErrorCode = (rawValue, removeNamespace = true) => { | ||
| const sanitizeErrorCode = (rawValue) => { | ||
| let cleanValue = rawValue; | ||
@@ -36,3 +36,3 @@ if (typeof cleanValue === "number") { | ||
| } | ||
| if (removeNamespace && cleanValue.indexOf("#") >= 0) { | ||
| if (cleanValue.indexOf("#") >= 0) { | ||
| cleanValue = cleanValue.split("#")[1]; | ||
@@ -43,8 +43,8 @@ } | ||
| export const loadRestJsonErrorCode = (output, data) => { | ||
| return loadErrorCode(output, data, true, ["header", "code", "type"]); | ||
| return loadErrorCode(output, data, ["header", "code", "type"]); | ||
| }; | ||
| export const loadJsonRpcErrorCode = (output, data, removeNamespace, queryCompat = false) => { | ||
| return loadErrorCode(output, data, removeNamespace, queryCompat ? ["code", "header", "type"] : ["type", "code", "header"]); | ||
| export const loadJsonRpcErrorCode = (output, data, queryCompat = false) => { | ||
| return loadErrorCode(output, data, queryCompat ? ["code", "header", "type"] : ["type", "code", "header"]); | ||
| }; | ||
| const loadErrorCode = ({ headers }, data, removeNamespace, order) => { | ||
| const loadErrorCode = ({ headers }, data, order) => { | ||
| while (order.length > 0) { | ||
@@ -56,3 +56,3 @@ const location = order.shift(); | ||
| if (headerKey !== undefined) { | ||
| return sanitizeErrorCode(headers[headerKey], removeNamespace); | ||
| return sanitizeErrorCode(headers[headerKey]); | ||
| } | ||
@@ -63,3 +63,3 @@ break; | ||
| if (codeKey && data[codeKey] !== undefined) { | ||
| return sanitizeErrorCode(data[codeKey], removeNamespace); | ||
| return sanitizeErrorCode(data[codeKey]); | ||
| } | ||
@@ -69,3 +69,3 @@ break; | ||
| if (data?.__type !== undefined) { | ||
| return sanitizeErrorCode(data.__type, removeNamespace); | ||
| return sanitizeErrorCode(data.__type); | ||
| } | ||
@@ -72,0 +72,0 @@ break; |
@@ -17,2 +17,2 @@ import type { HttpResponse, SerdeFunctions } from "@smithy/types"; | ||
| */ | ||
| export declare const loadJsonRpcErrorCode: (output: HttpResponse, data: any, removeNamespace: boolean, queryCompat?: boolean) => string | undefined; | ||
| export declare const loadJsonRpcErrorCode: (output: HttpResponse, data: any, queryCompat?: boolean) => string | undefined; |
@@ -17,4 +17,3 @@ import { HttpResponse, SerdeFunctions } from "@smithy/types"; | ||
| data: any, | ||
| removeNamespace: boolean, | ||
| queryCompat?: boolean | ||
| ) => string | undefined; |
+1
-1
| { | ||
| "name": "@aws-sdk/core", | ||
| "version": "3.974.11", | ||
| "version": "3.974.12", | ||
| "description": "Core functions & classes shared by multiple AWS SDK clients.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
0
-100%615257
-0.1%14626
-0.01%