This commit is contained in:
手瓜一十雪 committed 2024-08-04 23:26:51 +08:00
1 parent 27080e47bf
commit ef382148f2
6 files changed
+16 -15

No files matched your search

+2 -2
View File
@@ -86,7 +86,7 @@ export abstract class HttpServerBase {
this.start(port, host);
}
abstract handleFailed(res: Response, payload: any, err: any): void
abstract handleFailed(res: Response, payload: any, err: Error): void
registerRouter(method: 'post' | 'get' | string, url: string, handler: RegisterHandler) {
if (!url.startsWith('/')) {
@@ -111,7 +111,7 @@ export abstract class HttpServerBase {
try {
res.send(await handler(res, payload));
} catch (e: any) {
this.handleFailed(res, payload, e.stack.toString());
this.handleFailed(res, payload, e);
}
});
}