mondora / asteroid

An alternative client for a Meteor backend
MIT License
734 stars 101 forks source link

How to get meteor call error? #84

Closed radiegtya closed 8 years ago

radiegtya commented 8 years ago

Here is my code, the result return ok, but how to get the error?

$meteor.call("Chatapp.Channel.insert", doc).result.then(function(channelId){
   console.log(channelId); //this is working & the question is how to get the error result?
});

Thanks

idmontie commented 8 years ago

You can chain a catch onto your promise:

$meteor.call("Chatapp.Channel.insert", doc).result.then(function(channelId){
   console.log(channelId); //this is working & the question is how to get the error result?
}).catch(function(err) {
   console.log(err);
});
radiegtya commented 8 years ago

Cool @idmontie I'll try it and close the issue if success!!!

THanks

radiegtya commented 8 years ago

Cool @idmontie thats work! Thanks

I'll close this