Skip to content

Missing GrpcStatus in firestore #1064

Closed
@Thaina

Description

@Thaina

[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;
})

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions