feat: set python exception if an error happens in a js callback by sigmaSd · Pull Request #83 · denosaurs/deno_python · GitHub
Skip to content

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

Merged
eliassjogreen merged 3 commits into
denosaurs:mainfrom
sigmaSd:err
Jun 24, 2025
Merged

feat: set python exception if an error happens in a js callback#83
eliassjogreen merged 3 commits into
denosaurs:mainfrom
sigmaSd:err

Conversation

@sigmaSd

@sigmaSd sigmaSd commented Apr 21, 2025

Copy link
Copy Markdown
Contributor

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

sigmaSd commented Apr 21, 2025

Copy link
Copy Markdown
Contributor Author

@sigmaSd

sigmaSd commented Jun 21, 2025

Copy link
Copy Markdown
Contributor Author

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

sigmaSd commented Jun 21, 2025

Copy link
Copy Markdown
Contributor Author

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

@eliassjogreen eliassjogreen merged commit 8b06a60 into denosaurs:main Jun 24, 2025
@sigmaSd

sigmaSd commented Jun 25, 2025

Copy link
Copy Markdown
Contributor Author

Thanks @eliassjogreen would be great if you also push a new version to jsr

@eliassjogreen

Copy link
Copy Markdown
Member

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.

2 participants