mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Improve error handling in _observeChanges and selector compilation
This commit is contained in:
@@ -805,6 +805,8 @@ Object.assign(MongoConnection.prototype, {
|
||||
var self = this;
|
||||
const collectionName = cursorDescription.collectionName;
|
||||
|
||||
console.error('🔥 _observeChanges: CALLED with selector:', JSON.stringify(cursorDescription.selector));
|
||||
|
||||
if (cursorDescription.options.tailable) {
|
||||
return self._observeChangesTailable(cursorDescription, ordered, callbacks);
|
||||
}
|
||||
@@ -880,8 +882,15 @@ Object.assign(MongoConnection.prototype, {
|
||||
function () {
|
||||
// We need to be able to compile the selector. Fall back to polling for
|
||||
// some newfangled $selector that minimongo doesn't support yet.
|
||||
matcher = new Minimongo.Matcher(cursorDescription.selector);
|
||||
return !!matcher;
|
||||
try {
|
||||
matcher = new Minimongo.Matcher(cursorDescription.selector);
|
||||
return !!matcher;
|
||||
} catch (e) {
|
||||
if (e.message && (e.message.includes('needs an array') )) {
|
||||
throw e;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
},
|
||||
function () {
|
||||
// ... and the selector itself needs to support oplog.
|
||||
|
||||
Reference in New Issue
Block a user