Thanks to visit codestin.com
Credit goes to github.com

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

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Jun 21, 2025

bump @DjDeveloperr @eliassjogreen

I keep running into this issue once in a while, would be great if you merge this and push a new release

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Jun 21, 2025

Its also possible to print the error.stack when its available I dont know if it should be done by default or hidden behind maybe an env var, I just happen to need it for an issue and it was useful

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