Fix inconsistent unhandledrejection behavior when polyfill is used

This commit is contained in:
Kijin Sung 2025-06-18 18:54:07 +09:00
parent 87e34246f2
commit 083abbeacd

View file

@ -1111,6 +1111,15 @@ window.addEventListener('popstate', function(event) {
}
});
// Fix for browsers that don't support the unhandledrejection event
if (typeof Promise._unhandledRejectionFn !== 'undefined') {
Promise._unhandledRejectionFn = function(error) {
if (error['_rx_ajax_error']) {
alert(error.message.trim());
}
};
}
/**
* =================
* jQuery extensions