如何捕获包/库中抛出的内部错误消息?

发布于 2025-01-20 08:53:51 字数 53 浏览 1 评论 0原文

如何在我使用的软件包中丢弃的nodejs/express Js中的内部错误消息(例如,护照)

How can I catch an internal error message in nodejs/express js that is thrown from a package that I am using (e.g passport)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乄_柒ぐ汐 2025-01-27 08:53:51

嘿,最好在代码中使用 try 和 catch 块,以便查看第三方 api 抛出的错误

try {
// your code here
}catch(error){
 console.log(error)
}

Hey there it's best to use try and catch blocks in your code in order to see errors thrown from the third party api's

try {
// your code here
}catch(error){
 console.log(error)
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文