Is there a limit on how deeply you can throw Meteor.Error?


#1

I have a situation where I have a method (Meteor method) calling another method, which throws an error up to the first method, which should catch it. But instead, it just throws an exception in the server console.

Is there some limit as to how deep you can throw exceptions? Here’s an example showing what I’m encountering:

Meteor.methods({
  outerMethod: function () {
    try {
      Meteor.call('innerMethod', function (error, result) {
        if (error) {
          // the value of error.error === 'error-y'
          throw new Meteor.Error('error-x');
        }
      });
    } catch (e) {
      throw new Meteor.Error('unseen-error');
    }
  },

  innerMethod: function () {
    throw new Meteor.Error('error-y');
  }
});

So I never see innerMethod's error, which is correct. But I see error-x dumped to the server console, when I expect to see unseen-error shown instead. Why?