Cannot catch exception thrown by mixpanel.track

Viewed 19

I'm using mixpanel for tracking / analytics in my Ionic+Angular project. I want to catch the exception thrown by the mixpanel.track.

Tried Methods?

mixpanel.track returns Promise, on which I did tried using catch handler, but the issue I came to know is mixpanel.track is always(mostly?) resolving this Promise with the OK string immediately, and then after that when it actually sends the event back to sentry server, it throws the error around - Missing value for and so on (the error here is not the concern, but the handling of it is).


mixpanel.track('MyEventName', myEventProperties).then(data => {
   console.log('Even when there is error, mixpanel return OK in data, ', data);
}).catch(err => {
    console.log('Not getting the mixpanel error in here as expected', err);
})

Is there any way / mixpanel API which I'm supposed to use in order to get these exceptions that I can handle more gracefully, or is this some sort of bug with the mixpanel that should be fixed by them?

0 Answers
Related