Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/utils/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
});
Expand Down