The error is hard to debug: the message is undefined and the stack is (raven-js 3.25.2)
at captureMessage(…/node_modules/raven-js/src/raven.js:583:1)
at captureException(…/node_modules/raven-js/src/raven.js:507:1)
at _promiseRejectionHandler(…/node_modules/raven-js/src/raven.js:431:1)
at _promiseRejectionHandler([native code])
The breacrumb does not help me to debug (I can’t find a pattern that trigger the error). However I noticed that this error happens 98% on iPad.
How would you do to debug this error?
Thanks for your help,
Nicolas
Browsers don’t have a stack trace if an error occurs in a promise. Having a handler for the ‘error’ or ‘unhandledrejection’ events doesn’t help either.
In the other words: unhandled errors in promises will always be as undefined without any stack trace.
The only workaround I found for now is to have a .catch for each promise. After adding a .catch for some promises showed that the number of undefined errors decreased significantly.
The .catch handler is also a good practice as you don’t leave unhandled errors. You can fail silently, log error or show a modal to a user. But it will be clear from the code, that a promise have a meaningful error handler.