Parameters
Callback Parameters
Return Value
my.onUnhandledRejection(callback) returns a listener object. Call its remove() method to stop listening.
Code Example
Basic Usage
Error Logging
Development Debugging
Common Causes
Unhandled Promise rejections typically occur when:Missing .catch() Handler
Missing .catch() Handler
Missing try/catch with async/await
Missing try/catch with async/await
Errors in Promise Chains
Errors in Promise Chains
Related APIs
my.offUnhandledRejection
Stop listening for unhandled rejections
my.onError
Listen for JS errors