Right now, for no apparent reason I can not get throw new Meteor.Error(etc, etc) to throw from the server in a methods method and populate into the callback in Safari and Firefox. It does however appear to work almost everytime for Chrome. I can get some code samples when the form seems to be up again.
现在,由于没有明显的原因,我无法在方法方法中抛出新的Meteor.Error(等等)从服务器抛出并填充到Safari和Firefox的回调中。但它似乎几乎每次都适用于Chrome。当表单似乎再次出现时,我可以获得一些代码示例。
server/signup.js
Meteor.methods({
createCustomer: function(email, card) {
console.log('server');
if (!email || !card) {
throw new Meteor.Error('missing fields');
}
return {
id: 1,
email: email,
card: card
};
},
createCustomerSubscription: function(custId, plan) {
return {
plan: {
customerId: custId,
name: plan
}
};
}
});
client/signup.js
Meteor.call('createCustomer', customer, function(error, response) {
if (error) {
return console.log(error);
} else {
return console.log(response);
}
});
I am seeing the console log for the that says server, in the terminal, but do not see any browser console logs in Safari or Firefox, yet I do in Chrome.
我在终端中看到了服务器的控制台日志,但是在Safari或Firefox中没有看到任何浏览器控制台日志,但我在Chrome中看到了。
1 个解决方案
#1
Aw shucks...found the issue. Appears it was waiting on a sub from SubsManager in the router configure block, which was blocking the error to be thrown back to the client...quite the rabbit hole to find the issue.
哎呀......找到了问题。看来它正在等待来自路由器配置块中的SubsManager的sub,这阻止了错误被抛回到客户端...相当兔子洞找到问题。
#1
Aw shucks...found the issue. Appears it was waiting on a sub from SubsManager in the router configure block, which was blocking the error to be thrown back to the client...quite the rabbit hole to find the issue.
哎呀......找到了问题。看来它正在等待来自路由器配置块中的SubsManager的sub,这阻止了错误被抛回到客户端...相当兔子洞找到问题。