当您尝试使用 .prepare(#).get() 并且查询不存在时,我该如何处理发生的错误?
let businessType = DB.prepare(`SELECT businessType from 'Profiles' WHERE userId = '${author.id}'`).get().businessType;
所以基本上我如何在“businessType”不存在时停止崩溃,而不是脚本崩溃,我可以发送一条消息,如“用户不存在”之类的。
提前致谢!
当您尝试使用 .prepare(#).get() 并且查询不存在时,我该如何处理发生的错误?
let businessType = DB.prepare(`SELECT businessType from 'Profiles' WHERE userId = '${author.id}'`).get().businessType;
所以基本上我如何在“businessType”不存在时停止崩溃,而不是脚本崩溃,我可以发送一条消息,如“用户不存在”之类的。
提前致谢!