ITADN

Unhandled Promise Risk from manager.spawn() in shard.js

#335OpenMadhuNimmo 创建于 2025-07-04
M
MadhuNimmocommented
While analyzing using a static analysis tool, I found that in [shard.js](https://github.com/Maseshi/Shioru/blob/main/shard.js), the call to manager.spawn() at the end of the file does not handle the returned Promise: ```js manager.spawn(); ``` The spawn() function is asynchronous and may reject in several failure modes, such as: - timeout during shard readiness, - unexpected process death, - disconnection during startup. According to best practices for async calls in JavaScript: - A Promise should be either awaited with try/catch, or - explicitly .then().catch() chained, or - ignored with void if safe.
0 条评论