Add error handlers to catch stack trace on error. Available for Windows Desktop but don't work for UWP.