Add stack trace option to CanteraError#1730
Merged
ischoegl merged 4 commits intoCantera:mainfrom Jul 9, 2024
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1730 +/- ##
=======================================
Coverage 72.80% 72.80%
=======================================
Files 381 381
Lines 54022 54033 +11
Branches 9210 9213 +3
=======================================
+ Hits 39330 39341 +11
Misses 11707 11707
Partials 2985 2985 ☔ View full report in Codecov by Sentry. |
Capturing stack trace info in this test slows things down a lot due to the large number of exceptions thrown along the way.
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.
Changes proposed in this pull request
Add a static method
CanteraError::setStackTraceDepththat can be used to add the top N C++ stack frames to the message of aCanteraError. This can provide additional context on where certain errors are being thrown from.If applicable, provide an example illustrating new features this pull request is introducing
From Python, instantiate a
Solutionobject where the YAML file specifies a negative temperature for the initial state:Now, the Python traceback is followed by the
CanteraErrormessage and the top of the C++ stack:Checklist
scons build&scons test) and unit tests address code coverage