Created
July 28, 2015 22:22
-
-
Save yankeyhotel/5e5c8e6867b84a06d621 to your computer and use it in GitHub Desktop.
How to throw an error in a Meteor method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use this for testing (Note: this is not how you test).