@wise-old-man/utils 3.3.13 → 3.3.14
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/dist/cjs/index.cjs +3 -2
- package/dist/es/index.js +3 -2
- package/dist/es/index.mjs +3 -2
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -69,7 +69,7 @@ function handleError(status, path, data) {
|
|
|
69
69
|
throw new BadRequestError(path, data.message, data.data);
|
|
70
70
|
}
|
|
71
71
|
if (status === 403) {
|
|
72
|
-
throw new ForbiddenError(path, data.message);
|
|
72
|
+
throw new ForbiddenError(path, data.message, data.data);
|
|
73
73
|
}
|
|
74
74
|
if (status === 404) {
|
|
75
75
|
throw new NotFoundError(path, data.message);
|
|
@@ -91,11 +91,12 @@ class BadRequestError extends Error {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
class ForbiddenError extends Error {
|
|
94
|
-
constructor(resource, message) {
|
|
94
|
+
constructor(resource, message, data) {
|
|
95
95
|
super(message);
|
|
96
96
|
this.name = 'ForbiddenError';
|
|
97
97
|
this.resource = resource;
|
|
98
98
|
this.statusCode = 403;
|
|
99
|
+
this.data = data;
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
class NotFoundError extends Error {
|
package/dist/es/index.js
CHANGED
|
@@ -67,7 +67,7 @@ function handleError(status, path, data) {
|
|
|
67
67
|
throw new BadRequestError(path, data.message, data.data);
|
|
68
68
|
}
|
|
69
69
|
if (status === 403) {
|
|
70
|
-
throw new ForbiddenError(path, data.message);
|
|
70
|
+
throw new ForbiddenError(path, data.message, data.data);
|
|
71
71
|
}
|
|
72
72
|
if (status === 404) {
|
|
73
73
|
throw new NotFoundError(path, data.message);
|
|
@@ -89,11 +89,12 @@ class BadRequestError extends Error {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
class ForbiddenError extends Error {
|
|
92
|
-
constructor(resource, message) {
|
|
92
|
+
constructor(resource, message, data) {
|
|
93
93
|
super(message);
|
|
94
94
|
this.name = 'ForbiddenError';
|
|
95
95
|
this.resource = resource;
|
|
96
96
|
this.statusCode = 403;
|
|
97
|
+
this.data = data;
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
class NotFoundError extends Error {
|
package/dist/es/index.mjs
CHANGED
|
@@ -67,7 +67,7 @@ function handleError(status, path, data) {
|
|
|
67
67
|
throw new BadRequestError(path, data.message, data.data);
|
|
68
68
|
}
|
|
69
69
|
if (status === 403) {
|
|
70
|
-
throw new ForbiddenError(path, data.message);
|
|
70
|
+
throw new ForbiddenError(path, data.message, data.data);
|
|
71
71
|
}
|
|
72
72
|
if (status === 404) {
|
|
73
73
|
throw new NotFoundError(path, data.message);
|
|
@@ -89,11 +89,12 @@ class BadRequestError extends Error {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
class ForbiddenError extends Error {
|
|
92
|
-
constructor(resource, message) {
|
|
92
|
+
constructor(resource, message, data) {
|
|
93
93
|
super(message);
|
|
94
94
|
this.name = 'ForbiddenError';
|
|
95
95
|
this.resource = resource;
|
|
96
96
|
this.statusCode = 403;
|
|
97
|
+
this.data = data;
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
class NotFoundError extends Error {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise-old-man/utils",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.14",
|
|
4
4
|
"description": "A JavaScript/TypeScript client that interfaces and consumes the Wise Old Man API, an API that tracks and measures players' progress in Old School Runescape.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wiseoldman",
|