Skip to content
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

PythonError type name is lost #32

Closed
s-cork opened this issue Apr 8, 2023 · 1 comment
Closed

PythonError type name is lost #32

s-cork opened this issue Apr 8, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@s-cork
Copy link

s-cork commented Apr 8, 2023

value.toString in python for an exception loses the type information which is particularly handy for debugging

suggested alternative

  let errorMessage = (value ?? type).getAttr("__repr__").call().toString();
Fund with Polar
@eliassjogreen eliassjogreen added the bug Something isn't working label May 8, 2023
@eliassjogreen
Copy link
Member

Closed by #42. PythonErrors now contain the https://github.com/denosaurs/deno_python/blob/main/src/python.ts#L793-L795 type, value and traceback as PyObjects making it easy to actually catch and use the thrown value and type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants