Closed
Description
[REQUIRED] Step 2: Describe your environment
- Operating System version: firebase functions
- Firebase SDK version: 9.2.0
- Firebase Product: firestore
- Node.js version: 12
- NPM version: 6.14.8
[REQUIRED] Step 3: Describe the problem
I try to check a status code of firestore error without hardcode symbol and turn out GrpcStatus which exist in js firestore package are not exist in admin.firestore
for node js
Should there be anything defined for firestore error code?
return admin.firestore().runTransaction((transaction) => {
// do transaction
return Promise.resolve();
}).catch((e) => {
if(e?.code != admin.firestore.GrpcStatus.ALREADY_EXISTS) // error here
throw e;
})