meteor / meteor

Meteor, the JavaScript App Platform

Home Page:https://meteor.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Meteor 3] Uncaught Promise Rejection when throwing stub error

jamauro opened this issue · comments

When throwing a stub error with Meteor.applyAsync, I see 3 Unhandled Promise Rejection errors in the browser console.

This is with 3.0-beta.0

// client
const promise = Meteor.applyAsync('test', ['thing'], {returnStubValue: true, throwStubExceptions: true});
promise.stubPromise.catch(e => console.error('stubPromise error', e))
promise.catch(e => console.error('serverPromise error', e))
// isomorphic method
Meteor.methods({
  'test': async function() {
    if (Meteor.isClient) {
      throw new Meteor.Error('negative')
    }

    return;
  }
});
Screenshot 2024-01-05 at 9 42 06 AM