Skip to content

Commit

Permalink
log errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Mårten Wikström committed Mar 19, 2018
1 parent e1a1b80 commit 5e49fd2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ class Private {

/* istanbul ignore next */
private onApplyError = (error: firebase.auth.Error) => {
const { code } = error;
const { code, message } = error;
const hasError = true;
const isSignedIn = false;
const uid = this.uid;

/* tslint:disable-next-line */
console.error("[firemob] authentication error " + code + ": " + message);

this.onApplyData(isSignedIn, uid, hasError, code);
}

Expand Down
6 changes: 6 additions & 0 deletions src/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,10 @@ class Private extends PrivateBase<firebase.firestore.DocumentSnapshot> {
this.data = snapshot.data();
super.onSnapshot(snapshot);
}

protected onError(error: firebase.firestore.FirestoreError) {
/* tslint:disable-next-line */
console.error("[firemob] document subscription error " + error.code + ": " + error.message);
super.onError(error);
}
}
3 changes: 3 additions & 0 deletions src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ class Private<
}

protected onError(error: firebase.firestore.FirestoreError) {
/* tslint:disable-next-line */
console.error("[firemob] query subscription error " + error.code + ": " + error.message);

this.detachAll();
super.onError(error);
}
Expand Down

0 comments on commit 5e49fd2

Please sign in to comment.