fix: 拦截异常
This commit is contained in:
1 parent
2d5b45dd82
commit
5825fd6f36
1 file changed
+3
@@ -58,6 +58,9 @@ export abstract class HttpServerBase {
|
|||||||
this.expressAPP.get('/', (req: Request, res: Response) => {
|
this.expressAPP.get('/', (req: Request, res: Response) => {
|
||||||
res.send(`${this.name}已启动`);
|
res.send(`${this.name}已启动`);
|
||||||
});
|
});
|
||||||
|
this.expressAPP.on('error', (err) => {
|
||||||
|
logError('HTTP服务启动失败', err.toString());
|
||||||
|
});
|
||||||
this.listen(port, host);
|
this.listen(port, host);
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
logError('HTTP服务启动失败', e.toString());
|
logError('HTTP服务启动失败', e.toString());
|
||||||
|
|||||||
Reference in new issue
Block a user