mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix: 拦截异常
This commit is contained in:
parent
2d5b45dd82
commit
5825fd6f36
@ -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());
|
||||||
@ -115,7 +118,7 @@ export abstract class HttpServerBase {
|
|||||||
const info = `${this.name} started ${host}:${port}`;
|
const info = `${this.name} started ${host}:${port}`;
|
||||||
log(info);
|
log(info);
|
||||||
});
|
});
|
||||||
}catch (e: any) {
|
} catch (e: any) {
|
||||||
logError('HTTP服务启动失败, 请检查监听的ip地址和端口', e.stack.toString());
|
logError('HTTP服务启动失败, 请检查监听的ip地址和端口', e.stack.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user