@ouroboros/body 1.0.1 → 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 +2 -1
- package/src/errors.d.ts +1 -0
- package/src/errors.js +1 -0
- package/src/errors.ts +1 -0
- package/src/index.js +2 -0
- package/src/index.ts +2 -0
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouroboros/body",
|
|
3
|
-
"version": "1.0.
|
|
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/errors.d.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
export declare const REST_REQUEST_DATA = 100;
|
|
11
11
|
export declare const REST_CONTENT_TYPE = 101;
|
|
12
12
|
export declare const REST_AUTHORIZATION = 102;
|
|
13
|
+
export declare const REST_LIST_TO_LONG = 103;
|
|
13
14
|
export declare const SERVICE_ACTION = 200;
|
|
14
15
|
export declare const SERVICE_STATUS = 201;
|
|
15
16
|
export declare const SERVICE_CONTENT_TYPE = 202;
|
package/src/errors.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
export const REST_REQUEST_DATA = 100;
|
|
12
12
|
export const REST_CONTENT_TYPE = 101;
|
|
13
13
|
export const REST_AUTHORIZATION = 102;
|
|
14
|
+
export const REST_LIST_TO_LONG = 103;
|
|
14
15
|
// Rest-OC Service related
|
|
15
16
|
export const SERVICE_ACTION = 200;
|
|
16
17
|
export const SERVICE_STATUS = 201;
|
package/src/errors.ts
CHANGED
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
|