526 core exceptions#537
Conversation
updating fork repo with upstream head
update main to upstream branch
…meters.cpp:206 for the error string.
There was a problem hiding this comment.
Pull request overview
This PR introduces a shared, solver-wide exception infrastructure (status codes, source locations, MPI-rank awareness, optional stack traces) and migrates XML parameter parsing and top-level driver error handling toward structured svmp::ParseException failures (per #526).
Changes:
- Added core exception/runtime headers (
Core/Exception.h,Core/PlatformSupport.h) and FE-specific exception types (FE/Common/FEException.h). - Replaced many XML parsing
std::runtime_error/null-text fall-through paths withsvmp::raise<svmp::ParseException>(SVMP_HERE, ...)plus helper “require_*” utilities. - Wrapped the solver’s
main()simulation path in atry/catchfor parse errors and added MPI cleanup via the new runtime helpers.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Code/Source/solver/main.cpp | Adds a try/catch boundary for XML parse exceptions and uses new MPI abort/finalize helpers. |
| Code/Source/solver/Parameters.h | Switches parsing-related failures from std::runtime_error to structured ParseException. |
| Code/Source/solver/Parameters.cpp | Adds XML/map “require_*” helpers and migrates many parsing errors to ParseException with improved diagnostics. |
| Code/Source/solver/FE/Common/FEException.h | Introduces FE-layer exception hierarchy built on the shared core exception base. |
| Code/Source/solver/Core/PlatformSupport.h | Implements platform/MPI utilities and stack trace capture used by the exception system. |
| Code/Source/solver/Core/Exception.h | Defines core exception types, formatter, raise/check helpers, and terminate handler. |
| Code/Source/solver/CMakeLists.txt | Wires new Core/FE exception headers into the solver build and adds include directories. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
whoops, can't spell. correcting occured -> occurred Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…:2547 for close quotes
- Renamed Code/Source/solver/Core/PlatformSupport.h to PlatformSupport.inl. - Updated Code/Source/solver/Core/Exception.h:131 to include it locally as "PlatformSupport.inl". - Added a private-include guard so PlatformSupport.inl errors if included directly instead of through Exception.h. - Updated Code/Source/solver/CMakeLists.txt:234 to include Core/*.inl in the solver source listing.
…le ExceptionBase catch
- Code/Source/solver/Parameters.cpp:205: fixed occured to occurred.
- Code/Source/solver/FE/Common/FEException.h:12: updated the comment to reference Exception.h.
- Code/Source/solver/main.cpp:714: added the final `catch (...)` so unknown non-std::exception throws
still report an error and call the MPI cleanup helpers.
|
Cancelling all of the CI runs except the last two so that we do not have to wait forever. |
aabrown100-git
left a comment
There was a problem hiding this comment.
Looks good to me!
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #537 +/- ##
==========================================
- Coverage 68.28% 68.15% -0.13%
==========================================
Files 172 174 +2
Lines 33997 34160 +163
Branches 5929 5932 +3
==========================================
+ Hits 23214 23281 +67
- Misses 10646 10742 +96
Partials 137 137 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@copilot resolve the merge conflicts in this pull request |
There was a problem hiding this comment.
Thank you @zasexton!
I have left a few comments, none of which is critical. This looks good to me!
addressing additional comments from michele
Current situation
Related to #526.
adds a shared solver exception framework and starts migrating top-level application-driver error handling to it. The branch introduces
Core/Exception.h,Core/PlatformSupport.h, andFE/Common/FEException.h, wires the new headers into the solver build, and updates XML parameter parsing plusmain.cpperror handling.This is important because it centralizes solver errors around consistent status codes, source locations, MPI rank awareness, and optional stack traces. It also replaces several XML parsing paths that could previously fall through as raw
std::out_of_range, null text/attribute handling, or generic runtime errors with structuredsvmp::ParseExceptionfailures.Release Notes
ParseException.consistently.
Documentation
The new exception headers include inline documentation and named exception/status types. No separate user documentation is required because these comprise internal error handling without changing solver XML syntax or runtime options.
Testing
Built the solver target successfully:
Remaining verification will come from GitHub action CI and current test infrastructure.
Code of Conduct & Contributing Guidelines