Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to throw an error in a Meteor method
Meteor.methods({
test: function() {
throw new Meteor.Error("name of the error", "Here is the reason");
}
});
Meteor.call('test', function(error, response){
if (error) {
console.log("error", error);
} else {
console.log("response", response);
}
});
@yankeyhotel

This comment has been minimized.

Copy link
Owner Author

yankeyhotel commented Jul 28, 2015

I use this for testing (Note: this is not how you test).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.