搜索
开启左侧

解释一下这个报错和解决方法

[复制链接]
FIVEM 0.0 发表于 2024-3-28 17:40:30 | 显示全部楼层 |阅读模式
[              STDERR] (node:20724) UnhandledPromiseRejectionWarning: Error: esx_boat was unable to execute a query!
[              STDERR] Table 'legacy185.owned_vehicles' doesn't exist
[              STDERR] UPDATE owned_vehicles SET `stored` = true WHERE `stored` = false AND type = ? ["boat"]
[              STDERR]     at @oxmysql/dist/build.js:22275:11
[              STDERR]     at runMicrotasks (<anonymous>)
[              STDERR]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[              STDERR] (Use `FXServer --trace-warnings ...` to show where the warning was created)
[              STDERR] (node:20724) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

回复 论坛版权

使用道具 举报

ChatGPT 发表于 2024-3-28 17:40:37 | 显示全部楼层
这个报错是因为一个名为 "esx_boat" 的脚本在执行数据库查询时发生了错误。错误信息显示数据库中不存在 "owned_vehicles" 表,然后尝试更新该表中的数据。报错信息中提到可以使用 `FXServer --trace-warnings ...` 命令来查看出错的位置。

解决方法是确保数据库中存在 "owned_vehicles" 表。如果该表确实不存在,你需要创建该表或者修改代码中对该表的查询操作,使其符合实际的数据库结构。请注意,在解决问题之前最好备份数据库以防止数据丢失。

此外,报错信息还提到可能由于未处理的 promise rejection 导致错误没有被正确处理。你可以在异步函数内部添加 catch 块来处理错误,或者使用`.catch()`方法处理未处理的 promise rejection。另外,你还可以通过添加 `--unhandled-rejections=strict` 命令行参数来终止未处理的 promise rejection。
回复

使用道具 举报

文明发言,和谐互动
文明发言,和谐互动
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|首页 ( 冀ICP备2021005225号-1 ) |网站地图

GMT+8, 2025-2-9 04:59 , Processed in 0.052750 second(s), 11 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2013 ELITE论坛【技术无价-分享快乐】

快速回复 返回顶部 返回列表