Skip to content

Commit

Permalink
feat: add console.error in all firestore catch blocks (#73)
Browse files Browse the repository at this point in the history
* added console.error firestore catch blocks

* changed package version
  • Loading branch information
MrSurana authored Mar 31, 2023
1 parent 4d17176 commit 4571c9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hackerrank/firepad",
"description": "Collaborative text editing powered by Firebase",
"version": "0.7.1-beta",
"version": "0.7.4-beta",
"author": {
"email": "[email protected]",
"name": "Progyan Bhattacharya",
Expand Down
15 changes: 11 additions & 4 deletions src/firestore-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export class FirestoreAdapter implements IDatabaseAdapter {
}
})
.catch((error) => {
console.log("Error getting cached document:", error);
console.error("[firestore] Error getting checkpoint", error);
});
}

Expand Down Expand Up @@ -340,9 +340,14 @@ export class FirestoreAdapter implements IDatabaseAdapter {
});
});

historyRef.get().then(() => {
this._handleInitialRevisions();
});
historyRef
.get()
.then(() => {
this._handleInitialRevisions();
})
.catch((error) => {
console.error("[firestore] Error getting initial revisions", error);
});
}

/**
Expand Down Expand Up @@ -724,6 +729,8 @@ export class FirestoreAdapter implements IDatabaseAdapter {
}
})
.catch((error) => {
console.error("[firestore] Error sending cursor", error);

if (typeof callback === "function") {
callback(error, cursor);
}
Expand Down

0 comments on commit 4571c9c

Please sign in to comment.