mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Improve error handling in MongoConnection by checking for QueryError instances
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { CLIENT_ONLY_METHODS, getAsyncMethodName } from 'meteor/minimongo/constants';
|
||||
import { QueryError } from 'meteor/minimongo/common';
|
||||
import path from 'path';
|
||||
import { AsynchronousCursor } from './asynchronous_cursor';
|
||||
import { Cursor } from './cursor';
|
||||
@@ -886,7 +887,7 @@ Object.assign(MongoConnection.prototype, {
|
||||
} catch (e) {
|
||||
// XXX make all compilation errors MinimongoError or something
|
||||
// so that this doesn't ignore unrelated exceptions
|
||||
if (e.name === 'QueryError') {
|
||||
if (Meteor.isServer && e instanceof QueryError) {
|
||||
throw e;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user