Return an error from method

on the client:'foo', bar, function(error, result) {
  if (error)
    console.log('something went wrong');

on the server:

  foo: function(bar) {
    if (test stuff) {
      // works
    } else {
      // return error

is there a way to return an error inside the method eg. using the error parameter of the method function?

1 Like

You want Meteor.Error:

1 Like