【发布时间】:2020-11-17 17:02:49
【问题描述】:
我正在为我的项目构建一个 API,我想抛出自定义错误以在我的应用程序中捕获它。
在the documentation 之后,我用代码“未知”抛出错误
throw new functions.https
.HttpsError("unknown",
"this is my error message",
{code :'myCustomCode',
message :'my custom message'}
)
然后,我发现了正确的消息和详细信息,但出现了“内部服务器错误”
我不确定这是使用云功能创建干净 API 的最佳方式。
你有什么建议吗?
【问题讨论】:
标签: javascript node.js firebase google-cloud-functions