@aws-sdk/xhr-http-handler 3.224.0 → 3.249.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.
@@ -65,7 +65,10 @@ class XhrHttpHandler extends events_1.EventEmitter {
65
65
  xhr.addEventListener("progress", (event) => {
66
66
  this.emit(XhrHttpHandler.EVENTS.PROGRESS, event, request);
67
67
  });
68
- xhr.addEventListener("error", reject);
68
+ xhr.addEventListener("error", (err) => {
69
+ const error = new Error(XhrHttpHandler.ERROR_IDENTIFIER + ": " + err);
70
+ reject(error);
71
+ });
69
72
  xhr.addEventListener("timeout", () => {
70
73
  reject(new Error("XMLHttpRequest timed out."));
71
74
  });
@@ -157,6 +160,7 @@ class XhrHttpHandler extends events_1.EventEmitter {
157
160
  }
158
161
  exports.XhrHttpHandler = XhrHttpHandler;
159
162
  XhrHttpHandler.EVENTS = EVENTS;
163
+ XhrHttpHandler.ERROR_IDENTIFIER = "XHR_HTTP_HANDLER_ERROR";
160
164
  const isForbiddenRequestHeader = (header) => {
161
165
  header = header.toLowerCase();
162
166
  if (header.startsWith("proxy-")) {
@@ -62,7 +62,10 @@ export class XhrHttpHandler extends EventEmitter {
62
62
  xhr.addEventListener("progress", (event) => {
63
63
  this.emit(XhrHttpHandler.EVENTS.PROGRESS, event, request);
64
64
  });
65
- xhr.addEventListener("error", reject);
65
+ xhr.addEventListener("error", (err) => {
66
+ const error = new Error(XhrHttpHandler.ERROR_IDENTIFIER + ": " + err);
67
+ reject(error);
68
+ });
66
69
  xhr.addEventListener("timeout", () => {
67
70
  reject(new Error("XMLHttpRequest timed out."));
68
71
  });
@@ -153,6 +156,7 @@ export class XhrHttpHandler extends EventEmitter {
153
156
  }
154
157
  }
155
158
  XhrHttpHandler.EVENTS = EVENTS;
159
+ XhrHttpHandler.ERROR_IDENTIFIER = "XHR_HTTP_HANDLER_ERROR";
156
160
  const isForbiddenRequestHeader = (header) => {
157
161
  header = header.toLowerCase();
158
162
  if (header.startsWith("proxy-")) {
@@ -15,6 +15,7 @@ export declare class XhrHttpHandler
15
15
  implements HttpHandler
16
16
  {
17
17
  static readonly EVENTS: XhrHttpHandlerEvents;
18
+ static readonly ERROR_IDENTIFIER = "XHR_HTTP_HANDLER_ERROR";
18
19
  private config?;
19
20
  private readonly configProvider;
20
21
  constructor(
@@ -45,6 +45,7 @@ export declare type XhrHttpHandlerEvents = {
45
45
  */
46
46
  export declare class XhrHttpHandler extends EventEmitter implements HttpHandler {
47
47
  static readonly EVENTS: XhrHttpHandlerEvents;
48
+ static readonly ERROR_IDENTIFIER = "XHR_HTTP_HANDLER_ERROR";
48
49
  private config?;
49
50
  private readonly configProvider;
50
51
  constructor(options?: XhrHttpHandlerOptions | Provider<XhrHttpHandlerOptions>);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/xhr-http-handler",
3
- "version": "3.224.0",
3
+ "version": "3.249.0",
4
4
  "description": "Provides a way to make requests using XMLHttpRequest",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
@@ -18,14 +18,14 @@
18
18
  "module": "./dist-es/index.js",
19
19
  "types": "./dist-types/index.d.ts",
20
20
  "dependencies": {
21
- "@aws-sdk/protocol-http": "3.224.0",
22
- "@aws-sdk/querystring-builder": "3.224.0",
23
- "@aws-sdk/types": "3.224.0",
21
+ "@aws-sdk/protocol-http": "3.226.0",
22
+ "@aws-sdk/querystring-builder": "3.226.0",
23
+ "@aws-sdk/types": "3.226.0",
24
24
  "events": "3.3.0",
25
25
  "tslib": "^2.3.1"
26
26
  },
27
27
  "devDependencies": {
28
- "@aws-sdk/abort-controller": "3.224.0",
28
+ "@aws-sdk/abort-controller": "3.226.0",
29
29
  "@tsconfig/recommended": "1.0.1",
30
30
  "concurrently": "7.0.0",
31
31
  "downlevel-dts": "0.10.1",