Add uncaughtExceptionHandler
This PR replaces https://github.com/Distributive-Network/PythonMonkey/pull/114 for the uncaughtExceptionHandler
Hold on. Despite the CI passes, I've found some bugs need to be addressed.
Hold on. Despite the CI passes, I've found some bugs need to be addressed.
Hi @Xmader what is the status of this PR?
Hi @Xmader what is the status of this PR?
This PR was put on hold because there were bugs in the event-loop code. Let me see if the bugs have already been fixed.
This PR was put on hold because there were bugs in the event-loop code. Let me see if the bugs have already been fixed.
~~@wesgarland Is this PR needed for the v1.0 release?~~
uncaughtExceptionHandler is indeed needed for situations like
async function main() {
throw new TypeError("abc")
}
main()
Prints out
Uncaught Error: Python SpiderMonkeyError: Error in file xxx.js, on line y, column z:
TypeError: abc
Stack Trace:
...
There is still a problem that needs to be addressed (maybe in a separate PR).
new Promise(function (resolve, reject)
{
reject(new Error('abc'));
});
new Promise(function (resolve, reject)
{
});
Expected:
Uncaught Error: abc
@xxx.js:3:10
@xxx.js:1:1
Actual: The program exits normally with exit code 0.
There is still a problem that needs to be addressed (maybe in a separate PR).
new Promise(function (resolve, reject)
{
reject(new Error('abc'));
});
new Promise(function (resolve, reject)
{
});
Expected:
Uncaught Error: abc
@xxx.js:3:10
@xxx.js:1:1
Actual: The program exits normally with exit code 0.
The changes in 1bcb1f85f1c4ad3a2264e37732733f043d85fb6b...28dcb36595f7e3c7e6eec8887395d556b0d50e7e are to make the program print the actual JS error than a double-wrapped SpiderMonkeyError.
From
Uncaught Error: Python SpiderMonkeyError: Error in file xxx.js, on line y, column z:
TypeError: abc
Stack Trace:
[email protected]:x:y
To barely
Uncaught TypeError: abc
[email protected]:x:y
The changes in 1bcb1f85f1c4ad3a2264e37732733f043d85fb6b...28dcb36595f7e3c7e6eec8887395d556b0d50e7e are to make the program print the actual JS error than a double-wrapped SpiderMonkeyError.
From
Uncaught Error: Python SpiderMonkeyError: Error in file xxx.js, on line y, column z:
TypeError: abc
Stack Trace:
[email protected]:x:y
To barely
Uncaught TypeError: abc
[email protected]:x:y
What does the latest comment refer to?
If I run
new Promise(function (resolve, reject) { reject(new Error('abc')); });
I get
Promise {
If I run async function main() { throw new TypeError("abc") }
main()
I get
Promise {
For the first one is there a missing call? Please clarify, please make your examples super clear
What does the latest comment refer to?
If I run
new Promise(function (resolve, reject) { reject(new Error('abc')); });
I get
Promise {
If I run async function main() { throw new TypeError("abc") }
main()
I get
Promise {
For the first one is there a missing call? Please clarify, please make your examples super clear
Please add some explicit tests for the new exception catching and reporting
Please add some explicit tests for the new exception catching and reporting
For the first one is there a missing call? Please clarify, please make your examples super clear
You'll need to put the whole thing into a js file and run it with pmjs.
For the first one is there a missing call? Please clarify, please make your examples super clear
You'll need to put the whole thing into a js file and run it with pmjs.
For the first one is there a missing call? Please clarify, please make your examples super clear
You'll need to put the whole thing into a js file and run it with
pmjs.
Please provide details right here. What whole thing from above? I tried putting some of it in a file and when run there was no output. Let's be precise and explicit. Make it easy for your reviewer
For the first one is there a missing call? Please clarify, please make your examples super clear
You'll need to put the whole thing into a js file and run it with
pmjs.
Please provide details right here. What whole thing from above? I tried putting some of it in a file and when run there was no output. Let's be precise and explicit. Make it easy for your reviewer
@philippedistributive when run there was no output
That's correct. It's expected to be an error but it exited normally without any error output.
I should make it more clear by adding a console.log
@philippedistributive when run there was no output
That's correct. It's expected to be an error but it exited normally without any error output.
I should make it more clear by adding a console.log
https://github.com/Distributive-Network/PythonMonkey/pull/156#issuecomment-2112867758 remains
@philippedistributive when run there was no output
That's correct. It's expected to be an error but it exited normally without any error output. I should make it more clear by adding a
console.log
Now works
Also works for errors thrown in async functions
Also works for errors thrown in async functions
@philippedistributive https://github.com/Distributive-Network/PythonMonkey/pull/156#issuecomment-2112867758 done
@philippedistributive https://github.com/Distributive-Network/PythonMonkey/pull/156#issuecomment-2112867758 done
@Xmader what do you make of the failed test?
@Xmader what do you make of the failed test?
@Xmader what do you make of the failed test?
The failed tests may be related to https://github.com/Distributive-Network/PythonMonkey/pull/353. It segfaults on test_strings.py.
https://github.com/Distributive-Network/PythonMonkey/actions/runs/9353575587/job/25744630014?pr=156#step:13:162
@Xmader what do you make of the failed test?
The failed tests may be related to https://github.com/Distributive-Network/PythonMonkey/pull/353. It segfaults on test_strings.py.
https://github.com/Distributive-Network/PythonMonkey/actions/runs/9353575587/job/25744630014?pr=156#step:13:162
