在哪里可以找到NodeJS Firebase Admin SDK的所有错误返回代码



我根本找不到NodeJS Admin SDK在发送消息时可以返回的所有错误代码。例如,使用此代码:

this.app
.messaging()
.sendToDevice(an_invalid_registration_token, message, {
priority: 'high',
})
.then((response: MessagingDevicesResponse) => {
console.log(response.results[0].error)
})

它会输出给我这个:

{
errorInfo: {
code: 'messaging/invalid-registration-token',
message: 'Invalid registration token provided. Make sure it matches the registration token the client app receives from registering with FCM.'
},
codePrefix: 'messaging'
}

首先,这个输出与文档描述的不同(我自愿删除了这里的堆栈(,您可以看到文档中没有定义属性codePrefix。但我也不能像这里出现的messaging/invalid-registration-token那样处理所有的错误代码。我确实找到了所有这些错误代码,但我在示例中遇到的错误代码在这里列出。那么,其他地方还有其他名单吗?

我是错过了什么还是做错了什么?

错误代码列表在FCM文档中。

相关内容

最新更新