Skip to content

Allow decoding instanceless exceptions #1544

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

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

lostmsu
Copy link
Member

@lostmsu lostmsu commented Sep 5, 2021

What does this implement/fix? Explain your changes.

Added new Python class clr.interop.PyErr with optional type, value, and traceback attributes. User can register decoders for it, that would let them decode instanceless (and even typeless) Python exceptions.

These decoders will be invoked before the regular exception instance decoders.

This allows decoding exceptions before they are normalized (which is not always possible).

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Updated the CHANGELOG

@lostmsu lostmsu force-pushed the decode-instanceless-exn branch from 3180f29 to c5607ec Compare September 5, 2021 19:21
@lostmsu lostmsu requested a review from filmor September 14, 2021 19:26
@lostmsu lostmsu force-pushed the decode-instanceless-exn branch 2 times, most recently from 8a3647d to bb54fc6 Compare September 21, 2021 19:02
Added new class clr.interop.PyErr with optional type, value, and traceback attributes. User can register decoders for it, that would let them decode instanceless (and even typeless) Python exceptions.

These decoders will be invoked before the regular exception instance decoders.
@lostmsu lostmsu force-pushed the decode-instanceless-exn branch from bb54fc6 to a5bb294 Compare September 22, 2021 17:47
@lostmsu lostmsu merged commit 832126c into pythonnet:master Sep 22, 2021
@lostmsu lostmsu deleted the decode-instanceless-exn branch September 22, 2021 21:05
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