I try to match to handle this error of this function, I want to continue to execute all remaining code even if user FCM is not vailed.
try {
admin.messaging().send(fcmToOwnerBody,).catch((e)=>{
console.log("1* owner fcm token in invaild: " +e );
});
} catch (err) {
console.log("1 owner fcm token in invaild: " +err );
}
This the error of Function from logs
Error: The registration token is not a valid FCM registration token
at FirebaseMessagingError.FirebaseError [as constructor] (/workspace/node_modules/firebase-admin/lib/utils/error.js:44:28)
at FirebaseMessagingError.PrefixedFirebaseError [as constructor] (/workspace/node_modules/firebase-admin/lib/utils/error.js:90:28)
at new FirebaseMessagingError (/workspace/node_modules/firebase-admin/lib/utils/error.js:279:16)
at Function.FirebaseMessagingError.fromServerError (/workspace/node_modules/firebase-admin/lib/utils/error.js:312:16)
at Object.createFirebaseError (/workspace/node_modules/firebase-admin/lib/messaging/messaging-errors-internal.js:35:47)
at /workspace/node_modules/firebase-admin/lib/messaging/messaging-api-request-internal.js:79:51
at processTicksAndRejections (internal/process/task_queues.js:95:5)
The function carsh and response with [firebase_functions/internal]