@aws-amplify/predictions 4.0.22-unstable.5 → 4.0.22

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,14 @@
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.0.22](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/predictions@4.0.21...@aws-amplify/predictions@4.0.22) (2021-10-28)
7
+
8
+ **Note:** Version bump only for package @aws-amplify/predictions
9
+
10
+
11
+
12
+
13
+
6
14
  ## [4.0.21](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/predictions@4.0.20...@aws-amplify/predictions@4.0.21) (2021-10-21)
7
15
 
8
16
  **Note:** Version bump only for package @aws-amplify/predictions
@@ -98117,12 +98117,28 @@ function () {
98117
98117
  })
98118
98118
  };
98119
98119
  })["catch"](function (error) {
98120
- // Error
98120
+ var _a, _b, _c; // Error
98121
+
98122
+
98121
98123
  if (error.message !== _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_4__["AWSS3ProviderUploadErrorStrings"].UPLOAD_PAUSED_MESSAGE) {
98122
98124
  logger.error(error.message);
98123
- }
98125
+ } // for axios' cancel error, we should re-throw it back so it's not considered an s3client error
98126
+ // if we return empty, or an abitrary error HttpResponse, it will be hard to debug down the line
98124
98127
 
98125
- throw error;
98128
+
98129
+ if (axios__WEBPACK_IMPORTED_MODULE_2___default.a.isCancel(error)) {
98130
+ throw error;
98131
+ } // otherwise, we should re-construct an HttpResponse from the error, so that it can be passed down to other
98132
+ // aws sdk middleware (e.g retry, clock skew correction, error message serializing)
98133
+
98134
+
98135
+ return {
98136
+ response: new _aws_sdk_protocol_http__WEBPACK_IMPORTED_MODULE_0__["HttpResponse"]({
98137
+ statusCode: (_a = error.response) === null || _a === void 0 ? void 0 : _a.status,
98138
+ body: (_b = error.response) === null || _b === void 0 ? void 0 : _b.data,
98139
+ headers: (_c = error.response) === null || _c === void 0 ? void 0 : _c.headers
98140
+ })
98141
+ };
98126
98142
  }), requestTimeout(requestTimeoutInMs)];
98127
98143
  return Promise.race(raceOfPromises);
98128
98144
  };