Javascript 覆盖流星';s异常处理
我正试图使用sentry.io和Meteor。然而,Meteor似乎吞下了所有的错误,所以即使手动抛出异常,该代码也不会检测到它Javascript 覆盖流星';s异常处理,javascript,meteor,sentry,Javascript,Meteor,Sentry,我正试图使用sentry.io和Meteor。然而,Meteor似乎吞下了所有的错误,所以即使手动抛出异常,该代码也不会检测到它 process.on('uncaughtException', (err) => { console.log('exception') console.log(err) }); 是否有任何方法可以将全局错误处理程序添加到Meteor而不是它自己的内部错误处理程序,以便将其链接到自定义错误处理代码?您总是有机会捕获Meteor中的错误(例如,在Meteo
process.on('uncaughtException', (err) => {
console.log('exception')
console.log(err)
});
是否有任何方法可以将全局错误处理程序添加到Meteor而不是它自己的内部错误处理程序,以便将其链接到自定义错误处理代码?您总是有机会捕获Meteor中的错误(例如,在Meteor方法中)并自行处理。例如:
Meteor.methods({
someMethod() {
try {
const result = callToSentryFunc();
return result;
} catch (e) {
// e === an error object generated by sentry
throw new Meteor.Error('your-own-error-code',
'You can throw your own error that gets sent back to the client');
}
},
});
你总是有机会捕捉流星中的错误(例如流星方法中的错误)并自己处理。例如:
Meteor.methods({
someMethod() {
try {
const result = callToSentryFunc();
return result;
} catch (e) {
// e === an error object generated by sentry
throw new Meteor.Error('your-own-error-code',
'You can throw your own error that gets sent back to the client');
}
},
});