@aws-sdk/core 3.810.0 → 3.812.0

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.
@@ -148,11 +148,14 @@ var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
148
148
  if (headerKey !== void 0) {
149
149
  return sanitizeErrorCode(output.headers[headerKey]);
150
150
  }
151
- if (data.code !== void 0) {
152
- return sanitizeErrorCode(data.code);
153
- }
154
- if (data["__type"] !== void 0) {
155
- return sanitizeErrorCode(data["__type"]);
151
+ if (data && typeof data === "object") {
152
+ const codeKey = findKey(data, "code");
153
+ if (codeKey && data[codeKey] !== void 0) {
154
+ return sanitizeErrorCode(data[codeKey]);
155
+ }
156
+ if (data["__type"] !== void 0) {
157
+ return sanitizeErrorCode(data["__type"]);
158
+ }
156
159
  }
157
160
  }, "loadRestJsonErrorCode");
158
161
 
@@ -42,10 +42,13 @@ export const loadRestJsonErrorCode = (output, data) => {
42
42
  if (headerKey !== undefined) {
43
43
  return sanitizeErrorCode(output.headers[headerKey]);
44
44
  }
45
- if (data.code !== undefined) {
46
- return sanitizeErrorCode(data.code);
47
- }
48
- if (data["__type"] !== undefined) {
49
- return sanitizeErrorCode(data["__type"]);
45
+ if (data && typeof data === "object") {
46
+ const codeKey = findKey(data, "code");
47
+ if (codeKey && data[codeKey] !== undefined) {
48
+ return sanitizeErrorCode(data[codeKey]);
49
+ }
50
+ if (data["__type"] !== undefined) {
51
+ return sanitizeErrorCode(data["__type"]);
52
+ }
50
53
  }
51
54
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/core",
3
- "version": "3.810.0",
3
+ "version": "3.812.0",
4
4
  "description": "Core functions & classes shared by multiple AWS SDK clients.",
5
5
  "scripts": {
6
6
  "build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",