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

Move post_init_error again under exception handling block #171

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

antonpirker
Copy link

@antonpirker antonpirker commented Sep 3, 2024

Issue #, if available: #172

Description of changes:

Move post_init_error again under exception handling block to preserve possibility of calling sys.exc_info() in monkey patched post_init_error function.

Target (OCI, Managed Runtime, both):

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…e possibility of sys.exc_info() in monkey patched post_init_error function
@trivenay
Copy link
Contributor

trivenay commented Sep 3, 2024

Hey this change will break the functionality because we call the post_init_errorr in both the cases i.e during FaultException and generic Exception. If we move the call under Exception if the exception is caught in the FaultException block it won't call post_init_error

However we could refactor the piece of code to just have the Exception block and in that check it's type, if it's a FaultException exception then the way we generate error_result will change

In this way we can keep the error reporting functionality and your monkey patching would work. Although I would recommend to to take dependency on such specific behaviour as it is bound to change over a period of time

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