Fix thrown exceptions is within functions in WCI#26
Open
agoscinski wants to merge 1 commit intoosscar-org:mainfrom
Open
Fix thrown exceptions is within functions in WCI#26agoscinski wants to merge 1 commit intoosscar-org:mainfrom
agoscinski wants to merge 1 commit intoosscar-org:mainfrom
Conversation
When an exception is thrown within a WCI, the last frame is used as context to add the input lines. This does not work if the exception is thrown within a function within WCI. Therefore we now iterate through all traceback frames to find the one corresponding to WCI.
Author
|
It seems like one cannot change the error message later in the error message stack. I can iterate through the traceback frames retrieving some information about the errors in the stack but I cannot get the current exception info and adapt as with sys.exc_info() the current one. |
agoscinski
added a commit
to osscar-org/scicode-widgets
that referenced
this pull request
Jul 15, 2024
When an exception is thrown within a WCI, the last frame is used as context to add the input lines. This does not work if the exception is thrown within a function within WCI. Therefore we now iterate through all traceback frames to find the one corresponding to WCI. Will be fixed in wci osscar-org/widget-code-input#26
agoscinski
added a commit
to osscar-org/scicode-widgets
that referenced
this pull request
Sep 23, 2024
When an exception is thrown within a WCI, the last frame is used as context to add the input lines. This does not work if the exception is thrown within a function within WCI. Therefore we now iterate through all traceback frames to find the one corresponding to WCI. The corresponding PR in WCI osscar-org/widget-code-input#26 to solve it there.
agoscinski
added a commit
to osscar-org/scicode-widgets
that referenced
this pull request
Sep 23, 2024
When an exception is thrown within a WCI, the last frame is used as context to add the input lines. This does not work if the exception is thrown within a function within WCI. Therefore we now iterate through all traceback frames to find the one corresponding to WCI. The corresponding PR in WCI osscar-org/widget-code-input#26 to solve it there.
agoscinski
added a commit
to osscar-org/scicode-widgets
that referenced
this pull request
Sep 24, 2024
When an exception is thrown within a WCI, the last frame is used as context to add the input lines. This does not work if the exception is thrown within a function within WCI. Therefore we now iterate through all traceback frames to find the one corresponding to WCI. The corresponding PR in WCI osscar-org/widget-code-input#26 to solve it there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an exception is thrown within a WCI, the last frame is used as context to add the input lines. This does not work if the exception is thrown within a function within WCI. Therefore we now iterate through all traceback frames to find the one corresponding to WCI.
Still WIP, because the error message is reprinted completely, better to update the old one
Currently fix produces this