firebase / firebase/firebase-admin-node

[FR]Why does admin.send() return just the response name as error instead of the full response object

オープン
#2,693 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
api: messaging type: feature request
主要言語
TypeScript
スター
1.7k
フォーク
419
平均マージ
3日 10時間
マージ済み PR(30日)
16

説明

**Is your feature request related to a problem? Please describe.**

I need to be able handle and cleanup tokens that have expired or are not working for whatever reason. I just migrated from sendToDevice to send and I was surprise that only a string response/error is returned when send is called.

**Describe the solution you'd like**

A response object that contains status, error code and message

similar to the return type of the now deprecated sendToDevice method

export interface FirebaseError {

code: string;

message: string;

stack?: string;

toJSON(): object;
}

**Describe alternatives you've considered**

There is no exhaustive list of all the error so there is no way for me to know when to remove expired token from my DB or keep them

**Additional context**

it is a bit wierd that other methods get a proper error object but send just gets a string error

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。