@byloth/core 2.2.8 → 2.2.9
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/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +20 -18
- package/dist/core.esm.js.map +1 -1
- package/dist/core.global.js +1 -1
- package/dist/core.global.js.map +1 -1
- package/dist/core.umd.cjs +1 -1
- package/dist/core.umd.cjs.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +1 -1
- package/src/models/exceptions/index.ts +14 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byloth/core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.9",
|
|
4
4
|
"description": "An unopinionated collection of useful functions and classes that I use widely in all my projects. 🔧",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Core",
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@byloth/eslint-config-typescript": "^4.0.1",
|
|
53
53
|
"@eslint/compat": "^2.1.0",
|
|
54
|
-
"@types/node": "^24.12.
|
|
55
|
-
"@vitest/coverage-v8": "^4.1.
|
|
54
|
+
"@types/node": "^24.12.4",
|
|
55
|
+
"@vitest/coverage-v8": "^4.1.6",
|
|
56
56
|
"eslint": "^10.3.0",
|
|
57
57
|
"husky": "^9.1.7",
|
|
58
58
|
"jsdom": "^29.1.1",
|
|
59
59
|
"typescript": "^6.0.3",
|
|
60
|
-
"vite": "^8.0.
|
|
61
|
-
"vitest": "^4.1.
|
|
60
|
+
"vite": "^8.0.12",
|
|
61
|
+
"vitest": "^4.1.6"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"dev": "vite",
|
package/src/index.ts
CHANGED
|
@@ -251,7 +251,20 @@ export class ResponseException extends NetworkException
|
|
|
251
251
|
*/
|
|
252
252
|
public constructor(response: Response, cause?: unknown, name = "ResponseException")
|
|
253
253
|
{
|
|
254
|
-
|
|
254
|
+
let message: string;
|
|
255
|
+
|
|
256
|
+
const url = response.url ? ` to "${response.url}"` : "";
|
|
257
|
+
const status = response.statusText ? `${response.status} (${response.statusText})` : response.status;
|
|
258
|
+
if (response.statusText)
|
|
259
|
+
{
|
|
260
|
+
message = `The request${url} failed with status ${status}.`;
|
|
261
|
+
}
|
|
262
|
+
else
|
|
263
|
+
{
|
|
264
|
+
message = `The request${url} failed with status ${status}.`;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
super(message, cause, name);
|
|
255
268
|
|
|
256
269
|
this.response = response;
|
|
257
270
|
}
|