@wooksjs/event-http 0.5.11 → 0.5.13
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/index.cjs +4 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -5
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -579,7 +579,7 @@ class HttpErrorRenderer extends BaseHttpResponseRenderer {
|
|
|
579
579
|
`<head><title>${data.statusCode} ${httpStatusCodes[data.statusCode]}</title></head>` +
|
|
580
580
|
`<body><center><h1>${data.statusCode} ${httpStatusCodes[data.statusCode]}</h1></center>` +
|
|
581
581
|
`<center><h4>${data.message}</h1></center><hr color="#666">` +
|
|
582
|
-
`<center style="color: #666;"> Wooks v${"0.5.
|
|
582
|
+
`<center style="color: #666;"> Wooks v${"0.5.13"} </center>` +
|
|
583
583
|
`${keys.length > 0
|
|
584
584
|
? `<pre style="${preStyles}">${JSON.stringify({
|
|
585
585
|
...data,
|
|
@@ -980,17 +980,16 @@ class WooksHttp extends wooks.WooksAdapterBase {
|
|
|
980
980
|
const promise = handler();
|
|
981
981
|
const result = await promise;
|
|
982
982
|
this.respond(result);
|
|
983
|
-
|
|
983
|
+
return result;
|
|
984
984
|
}
|
|
985
985
|
catch (error) {
|
|
986
|
-
if (error instanceof HttpError)
|
|
987
|
-
this.logger.debug(`${error.body.statusCode}: ${error.message} :: ${store('event').get('req')?.url || ''}`);
|
|
988
|
-
}
|
|
986
|
+
if (error instanceof HttpError) ;
|
|
989
987
|
else {
|
|
990
988
|
this.logger.error(`Uncought route handler exception: ${store('event').get('req')?.url || ''}`, error);
|
|
991
989
|
}
|
|
992
990
|
if (isLastHandler) {
|
|
993
991
|
this.respond(error);
|
|
992
|
+
return error;
|
|
994
993
|
}
|
|
995
994
|
}
|
|
996
995
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -693,7 +693,7 @@ declare class WooksHttp extends WooksAdapterBase {
|
|
|
693
693
|
* ```
|
|
694
694
|
*/
|
|
695
695
|
getServerCb(): (req: IncomingMessage, res: ServerResponse) => void;
|
|
696
|
-
protected processHandlers(handlers: TWooksHandler[]): Promise<
|
|
696
|
+
protected processHandlers(handlers: TWooksHandler[]): Promise<unknown>;
|
|
697
697
|
}
|
|
698
698
|
/**
|
|
699
699
|
* Factory for WooksHttp App
|
package/dist/index.mjs
CHANGED
|
@@ -577,7 +577,7 @@ class HttpErrorRenderer extends BaseHttpResponseRenderer {
|
|
|
577
577
|
`<head><title>${data.statusCode} ${httpStatusCodes[data.statusCode]}</title></head>` +
|
|
578
578
|
`<body><center><h1>${data.statusCode} ${httpStatusCodes[data.statusCode]}</h1></center>` +
|
|
579
579
|
`<center><h4>${data.message}</h1></center><hr color="#666">` +
|
|
580
|
-
`<center style="color: #666;"> Wooks v${"0.5.
|
|
580
|
+
`<center style="color: #666;"> Wooks v${"0.5.13"} </center>` +
|
|
581
581
|
`${keys.length > 0
|
|
582
582
|
? `<pre style="${preStyles}">${JSON.stringify({
|
|
583
583
|
...data,
|
|
@@ -978,17 +978,16 @@ class WooksHttp extends WooksAdapterBase {
|
|
|
978
978
|
const promise = handler();
|
|
979
979
|
const result = await promise;
|
|
980
980
|
this.respond(result);
|
|
981
|
-
|
|
981
|
+
return result;
|
|
982
982
|
}
|
|
983
983
|
catch (error) {
|
|
984
|
-
if (error instanceof HttpError)
|
|
985
|
-
this.logger.debug(`${error.body.statusCode}: ${error.message} :: ${store('event').get('req')?.url || ''}`);
|
|
986
|
-
}
|
|
984
|
+
if (error instanceof HttpError) ;
|
|
987
985
|
else {
|
|
988
986
|
this.logger.error(`Uncought route handler exception: ${store('event').get('req')?.url || ''}`, error);
|
|
989
987
|
}
|
|
990
988
|
if (isLastHandler) {
|
|
991
989
|
this.respond(error);
|
|
990
|
+
return error;
|
|
992
991
|
}
|
|
993
992
|
}
|
|
994
993
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wooksjs/event-http",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
4
4
|
"description": "@wooksjs/event-http",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"url": "https://github.com/wooksjs/wooksjs/issues"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"wooks": "0.5.
|
|
42
|
+
"wooks": "0.5.13",
|
|
43
43
|
"@prostojs/router": "^0.2.1",
|
|
44
|
-
"@wooksjs/event-core": "0.5.
|
|
44
|
+
"@wooksjs/event-core": "0.5.13"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@prostojs/logger": "^0.4.0"
|