diff --git a/packages/firestore-compat/src/index.console.ts b/packages/firestore-compat/src/index.console.ts index 23d5da739db..be93038063f 100644 --- a/packages/firestore-compat/src/index.console.ts +++ b/packages/firestore-compat/src/index.console.ts @@ -105,9 +105,13 @@ export class Firestore extends FirestoreCompat { INTERNAL = { delete: () => this.terminate(), count: (query: Compat>) => { - return getCountFromServer(query._delegate).then(response => { - return response.data().count; - }); + return getCountFromServer(query._delegate) + .then(response => { + return response.data().count; + }) + .catch(error => { + throw new FirestoreError(error.code, error.message); + }); } }; }