svanlang opened a new issue, #1534:
URL: https://github.com/apache/cordova-ios/issues/1534
# Bug Report
## Problem
In my cordova app all js errors are captured through window.onerror =
function( errorMsg, url, lineNumber, column, errorObj )
This works fine on Android devices with line numbers, column number and
stack trace.
On IOs devices this just gives a SCRIPT ERROR with no further information.
### What is expected to happen?
I expect the error to have a bit more detail to it, like a stack trace
### What does actually happen?
On IOs devices this just gives a SCRIPT ERROR with no further information.
## Information
I have created a small test app and inside the index.js added
window.onerror = function (message, source, lineno, colno, error) {
console.log('[window.onerror]');
console.log('Message:', message);
console.log('Source:', source);
console.log('Line:', lineno, 'Col:', colno);
console.log('Error object:', error);
console.log('Stack trace:', error?.stack);
};
I tried the same with window.addEventListener('error', function (e) { but
same result.
for error i used
setTimeout(() => {
throw new Error("Simulated error for testing");
}, 5000);
### Environment, Platform, Device
Device:
Macbook pro m1
OS:
macOS 15.4.1
### Version information
Cordova 12.0.0 ([email protected])
ios platform version ios 7.1.1
xcode 16.3
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [ x] I searched for existing GitHub issues
- [x ] I updated all Cordova tooling to most recent version
- [ x] I included all the necessary information above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]