|
@@ -61,7 +61,17 @@ app.all('/download', function (req, res, next) {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+// 捕获未处理的异常
|
|
|
|
+process.on('uncaughtException', (error) => {
|
|
|
|
+ console.error("未处理的异常:", error);
|
|
|
|
+ // 这里可以添加更多的错误处理逻辑,比如发送通知或记录日志
|
|
|
|
+});
|
|
|
|
|
|
|
|
+// 捕获未处理的Promise拒绝
|
|
|
|
+process.on('unhandledRejection', (reason, promise) => {
|
|
|
|
+ console.error('未处理的Promise拒绝:', promise, '原因:', reason);
|
|
|
|
+ // 这里可以添加更多的错误处理逻辑,比如发送通知或记录日志
|
|
|
|
+});
|
|
// START THE SERVER
|
|
// START THE SERVER
|
|
// =============================================================================
|
|
// =============================================================================
|
|
app.listen(port, '0.0.0.0');
|
|
app.listen(port, '0.0.0.0');
|