Ability to catch asynchronous runtime errors #663
                  
                    
                      AlexMath23
                    
                  
                
                  started this conversation in
                Ideas
              
            Replies: 1 comment 3 replies
-
| 
         You can do this: window.addEventListener('unhandledrejection', event => {
    // TODO: handle an async rejection.
}); | 
  
Beta Was this translation helpful? Give feedback.
                  
                    3 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, we are currently using lvgljs with the txiki.js runtime. A nice certainty for us would to be to know that we can catch thrown runtime errors 100% of the time. But unfortunately in txiki.js we only have that certainty for the synchronous ones ( with React Error Boundary). If 3rd party libraries throw async errors in promises without proper catch blocks those will slip by. In the browser / node you can handle these async, uncaught errors on a global level like this.


But this doesn't seem to be possible in txiki.js
To me it seems like a nice feature to have so you can have absolute protection from runtime errors / ways to recover in critical systems.
Beta Was this translation helpful? Give feedback.
All reactions