@ouroboros/body 1.0.2 → 1.0.3

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/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@ouroboros/body",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Classes to communicate with Ouroboros Coding Inc. body services",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tslint -p tsconfig.json && tsc",
9
9
  "clean": "rm src/*.js src/*.d.ts",
10
+ "for_local": "npm install; tslint -p tsconfig.json && tsc; rm -Rf node_modules",
10
11
  "test": "echo \"Error: no test specified.\" && exit 1"
11
12
  },
12
13
  "repository": {
package/src/index.js CHANGED
@@ -85,12 +85,14 @@ class Body {
85
85
  if (this.verbose) {
86
86
  console.log(`xhr.abort:\n\t${ACTIONS_TO_METHODS[action]} ${url}\n\t`, event);
87
87
  }
88
+ handleError(`${ACTIONS_TO_METHODS[action]} ${url} was aborted`);
88
89
  });
89
90
  // Track errors
90
91
  xhr.addEventListener('error', event => {
91
92
  if (this.verbose) {
92
93
  console.log(`xhr.error:\n\t${ACTIONS_TO_METHODS[action]} ${url}\n\t`, event);
93
94
  }
95
+ handleError(`${ACTIONS_TO_METHODS[action]} ${url} failed to connect`);
94
96
  });
95
97
  // Handle successful request
96
98
  xhr.addEventListener('load', (event) => {
package/src/index.ts CHANGED
@@ -146,6 +146,7 @@ class Body {
146
146
  if(this.verbose) {
147
147
  console.log(`xhr.abort:\n\t${ACTIONS_TO_METHODS[action]} ${url}\n\t`, event);
148
148
  }
149
+ handleError(`${ACTIONS_TO_METHODS[action]} ${url} was aborted`)
149
150
  });
150
151
 
151
152
  // Track errors
@@ -153,6 +154,7 @@ class Body {
153
154
  if(this.verbose) {
154
155
  console.log(`xhr.error:\n\t${ACTIONS_TO_METHODS[action]} ${url}\n\t`, event);
155
156
  }
157
+ handleError(`${ACTIONS_TO_METHODS[action]} ${url} failed to connect`);
156
158
  });
157
159
 
158
160
  // Handle successful request