Recently I am working with Sentry to send exceptions to Server. I see that errors fron most of the immedate javascript execution statements are thrown to Window.onerror or else even If I wrap the code inside Raven.context(); the logs are sent to Server.
I have problem with callbacks; I see that this is not thrown in window.onerror at all (except in ajax errors). I cannot capture it even if it is inside Raven.context().
Ex: Raven.context(function(){
z=1; //throws error to window.onerror as well as logs to Sentry
RTBbg.checkLogin();
}
checkLogin: function(){
chrome.tabs.create({url:myurl},function(tab){
y=1; //error from here is not thrown to window.onerror or logged to Sentry even if it is under
//Raven.context
});
}
If I purposefuly wrap the above code
checkLogin: function(){
chrome.tabs.create({url:myurl},Raven.wrap(function(tab){
y=1; //error from here is not thrown to window.onerror but logged to Sentry
}));
}
Is there any easy way of doing this.
I see already a discussion related to this which talks about limitation
Do you have opinion on the below article. I see all errors are logged to console no matter synchrnous or asynchronous