Skip to content

feat: set python exception if an error happens in a js callback #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sigmaSd
Copy link
Contributor

@sigmaSd sigmaSd commented Apr 21, 2025

This changes errors like this

SystemError: <built-in method JSCallback:anonymous of NoneType object at 0x7f988b6f8bd0> returned NULL without setting an exception

To something more useful

RuntimeError: JS Callback Error: PythonError: Must be number, not str

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Apr 21, 2025

this last commit 0eed1e5 change

RuntimeError: JS Callback Error: PythonError: Must be number, not str

The above exception was the direct cause of the following exception:

SystemError: <built-in method JSCallback:anonymous of NoneType object at 0x7fc7e6cf8bd0> returned a result with an exception set

to just

RuntimeError: JS Callback Error: PythonError: Must be number, not str

I think the first one just have extra noise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant