You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 4, 2023. It is now read-only.
error: "Invalid eventType. Use one of the following: 'value', 'child_added', 'child_changed', 'child_removed', or 'child_moved'"
1661
-
});
1655
+
thrownewError(`${eventType} is not a valid eventType. Use one of the following: 'value', 'child_added', 'child_changed', 'child_removed', or 'child_moved'`);
1662
1656
}
1663
1657
// Add listener to our map which keeps track of eventType: child/value events
1664
1658
if(!Query.eventListenerMap.has(eventType)){
@@ -1667,6 +1661,9 @@ class Query implements QueryBase {
1667
1661
Query.eventListenerMap.get(eventType).push(listener);// We need to keep track of the listeners to fully remove them when calling off
1668
1662
}catch(ex){
1669
1663
console.error("Error in firebase.on: "+ex);
1664
+
if(cancelCallbackOrContext!==undefined){
1665
+
cancelCallbackOrContext(ex);
1666
+
}
1670
1667
}finally{
1671
1668
returncallback;
1672
1669
}
@@ -1693,7 +1690,7 @@ class Query implements QueryBase {
Query.eventListenerMap.get(eventType).push(firDatabaseHandle);// We need to keep track of the listeners to fully remove them when calling off
1415
+
}else{
1416
+
thrownewError(`${eventType} is not a valid eventType. Use one of the following: 'value', 'child_added', 'child_changed', 'child_removed', or 'child_moved'`);
1425
1417
}
1426
-
finally{
1427
-
returncallback;
1418
+
}catch(ex){
1419
+
// TODO: Make custom errors
1420
+
console.error("Error in firebase.on: "+ex);
1421
+
if(cancelCallbackOrContext!==undefined){
1422
+
cancelCallbackOrContext(ex);
1428
1423
}
1424
+
}
1425
+
finally{
1426
+
returncallback;
1427
+
}
1429
1428
}
1430
1429
1431
1430
once(eventType: string): Promise<DataSnapshot>{
@@ -1443,7 +1442,7 @@ class Query implements QueryBase {
1443
1442
});
1444
1443
});
1445
1444
}catch(ex){
1446
-
console.log("Error in firebase.once: "+ex);
1445
+
console.error("Error in firebase.once: "+ex);
1447
1446
reject(ex);
1448
1447
}
1449
1448
});
@@ -1548,16 +1547,16 @@ class Query implements QueryBase {
1548
1547
* to specific events (Android is more generic value / child - which includes all events add, change, remove etc).
1549
1548
* Similar to firebase._addObserver but I do not want to listen for every event
0 commit comments