diff --git a/packages/mongo/mongo_connection.js b/packages/mongo/mongo_connection.js index 36f8b0721f..5879d811c4 100644 --- a/packages/mongo/mongo_connection.js +++ b/packages/mongo/mongo_connection.js @@ -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;