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

have PyErr's Debug implementation call traceback.format() #4863

Open
nicolasavru opened this issue Jan 18, 2025 · 0 comments
Open

have PyErr's Debug implementation call traceback.format() #4863

nicolasavru opened this issue Jan 18, 2025 · 0 comments

Comments

@nicolasavru
Copy link

Could PyErr's Debug implementation call traceback.format()? Something like .field("traceback", &self.traceback(py).map(|tb| tb.format()))

Err(PyErr { type: <class 'SomeError'>, value: SomeError('some message'), traceback: Some(<traceback object at 0x53e96c8c6300>) }) isn't especially helpful and there doesn't seem to be a convenient way of getting a string (e.g., to pass to a logging library) of a PyErr with a traceback. I could write a function to do that, but it's easy to forget to call a custom function.

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

No branches or pull requests

1 participant