@aws-amplify/storage 4.4.5-unstable.5 → 4.4.5

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 CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.4.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/storage@4.4.4...@aws-amplify/storage@4.4.5) (2021-10-28)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **@aws-amplify/storage:** update axios http handler error handling ([#9125](https://github.com/aws-amplify/amplify-js/issues/9125)) ([55a78d6](https://github.com/aws-amplify/amplify-js/commit/55a78d6471306143eebbd855c246af225e8d90d8))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [4.4.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/storage@4.4.3...@aws-amplify/storage@4.4.4) (2021-10-21)
7
18
 
8
19
  **Note:** Version bump only for package @aws-amplify/storage
@@ -51145,12 +51145,28 @@ function () {
51145
51145
  })
51146
51146
  };
51147
51147
  })["catch"](function (error) {
51148
- // Error
51148
+ var _a, _b, _c; // Error
51149
+
51150
+
51149
51151
  if (error.message !== _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_4__["AWSS3ProviderUploadErrorStrings"].UPLOAD_PAUSED_MESSAGE) {
51150
51152
  logger.error(error.message);
51151
- }
51153
+ } // for axios' cancel error, we should re-throw it back so it's not considered an s3client error
51154
+ // if we return empty, or an abitrary error HttpResponse, it will be hard to debug down the line
51152
51155
 
51153
- throw error;
51156
+
51157
+ if (axios__WEBPACK_IMPORTED_MODULE_2___default.a.isCancel(error)) {
51158
+ throw error;
51159
+ } // otherwise, we should re-construct an HttpResponse from the error, so that it can be passed down to other
51160
+ // aws sdk middleware (e.g retry, clock skew correction, error message serializing)
51161
+
51162
+
51163
+ return {
51164
+ response: new _aws_sdk_protocol_http__WEBPACK_IMPORTED_MODULE_0__["HttpResponse"]({
51165
+ statusCode: (_a = error.response) === null || _a === void 0 ? void 0 : _a.status,
51166
+ body: (_b = error.response) === null || _b === void 0 ? void 0 : _b.data,
51167
+ headers: (_c = error.response) === null || _c === void 0 ? void 0 : _c.headers
51168
+ })
51169
+ };
51154
51170
  }), requestTimeout(requestTimeoutInMs)];
51155
51171
  return Promise.race(raceOfPromises);
51156
51172
  };