@arkyn/server 1.4.36 → 1.4.38
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/helpers/globalErrorHandler.js +1 -1
- package/dist/httpBadResponses/serverError.d.ts +3 -2
- package/dist/httpBadResponses/serverError.d.ts.map +1 -1
- package/dist/httpBadResponses/serverError.js +3 -1
- package/package.json +3 -2
- package/src/helpers/globalErrorHandler.ts +1 -1
- package/src/httpBadResponses/serverError.ts +4 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
declare function serverError(error:
|
|
1
|
+
declare function serverError(error: ServerError): import("undici-types").Response;
|
|
2
2
|
declare class ServerError {
|
|
3
3
|
name: string;
|
|
4
4
|
message: string;
|
|
5
|
-
|
|
5
|
+
cause: any;
|
|
6
|
+
constructor(message: string, cause?: any);
|
|
6
7
|
}
|
|
7
8
|
export { serverError, ServerError };
|
|
8
9
|
//# sourceMappingURL=serverError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverError.d.ts","sourceRoot":"","sources":["../../src/httpBadResponses/serverError.ts"],"names":[],"mappings":"AAAA,iBAAS,WAAW,CAAC,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"serverError.d.ts","sourceRoot":"","sources":["../../src/httpBadResponses/serverError.ts"],"names":[],"mappings":"AAAA,iBAAS,WAAW,CAAC,KAAK,EAAE,WAAW,mCActC;AAED,cAAM,WAAW;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,GAAG,CAAC;gBAEC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;CAKzC;AAED,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -13,9 +13,11 @@ function serverError(error) {
|
|
|
13
13
|
class ServerError {
|
|
14
14
|
name;
|
|
15
15
|
message;
|
|
16
|
-
|
|
16
|
+
cause;
|
|
17
|
+
constructor(message, cause) {
|
|
17
18
|
this.name = "ServerError";
|
|
18
19
|
this.message = message;
|
|
20
|
+
this.cause = cause;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
export { serverError, ServerError };
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkyn/server",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.38",
|
|
4
4
|
"main": "./dist/bundle.js",
|
|
5
5
|
"module": "./src/index.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"
|
|
9
|
+
"clean": "rm -rf dist",
|
|
10
|
+
"build": "bun run clean && bunx tsc --project tsconfig.json",
|
|
10
11
|
"typecheck": "bunx tsc --project tsconfig.json --noEmit"
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function serverError(error:
|
|
1
|
+
function serverError(error: ServerError) {
|
|
2
2
|
return new Response(
|
|
3
3
|
JSON.stringify({
|
|
4
4
|
status: 500,
|
|
@@ -17,10 +17,12 @@ function serverError(error: Error) {
|
|
|
17
17
|
class ServerError {
|
|
18
18
|
name: string;
|
|
19
19
|
message: string;
|
|
20
|
+
cause: any;
|
|
20
21
|
|
|
21
|
-
constructor(message: string) {
|
|
22
|
+
constructor(message: string, cause?: any) {
|
|
22
23
|
this.name = "ServerError";
|
|
23
24
|
this.message = message;
|
|
25
|
+
this.cause = cause;
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
|