diff --git a/lib/utils/client.js b/lib/utils/client.js index 5d2994a..59fafac 100644 --- a/lib/utils/client.js +++ b/lib/utils/client.js @@ -19,10 +19,12 @@ const applyOptions = { export function callMethod(name, args) { // args is expected to be an array return new Promise((resolve, reject) => { // we're wrapping in a promise to have the same interface for 2.x and 3.x. the callback is also needed in 3.x so that we can suppress the invocation-failed error in ddp.js - Meteor.applyAsync(name, args, applyOptions, (error, result) => { + Meteor.applyAsync(name, args, applyOptions).catch(error => { if (error) { reject(error) - } else { + } + }).then(result => { + if (result) { resolve(result) } });