common: reclassify exception types per AGENTS.md convention - #4492
Merged
Merged
Conversation
garth-wells
approved these changes
Sep 13, 2026
jhale
changed the base branch from
main
to
jhale/remove-function-space-check
September 13, 2026 10:16
jhale
added this pull request to stack #4494
September 13, 2026 10:16
Member
Author
|
Will rebase 😮 |
jhale
removed this pull request from stack #4494
September 13, 2026 12:37
jhale
changed the base branch from
jhale/remove-function-space-check
to
main
September 13, 2026 12:37
jhale
changed the base branch from
main
to
jhale/remove-function-space-check
September 13, 2026 12:38
jhale
added this pull request to stack #4498
September 13, 2026 12:38
jhale
removed this pull request from stack #4498
September 13, 2026 12:38
jhale
changed the base branch from
jhale/remove-function-space-check
to
main
September 13, 2026 12:38
jhale
added this pull request to stack #4499
September 13, 2026 12:38
Several `common` throws used `runtime_error` for what are really bad arguments or missing lookup keys. Switch to `invalid_argument` for argument-precondition failures (sort_unique, distribute_data, det/inv/pinv, Table::reduce, IndexMap::create_submap) and `out_of_range` for lookup-key failures (TimeLogger::timing, Table::get). Leaves Timer::flush (object state) and petsc.cpp (external library failure) as runtime_error. No message text changed. AI assistance: I used Claude to draft this PR. I reviewed, edited, tested, and take responsibility for the final contribution.
jhale
force-pushed
the
jhale/common-exception-reclassify
branch
from
September 14, 2026 13:10
baee656 to
f97670b
Compare
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.
Summary
commonthrows that werestd::runtime_errorfor bad arguments or missing lookup keys are reclassified per the AGENTS.md convention:std::invalid_argumentfor argument-precondition failures (sort_unique,distribute_data,math::det/inv/pinv,Table::reduce,IndexMap::create_submap),std::out_of_rangefor lookup-key failures (TimeLogger::timing,Table::get).Timer::flush(object-state error) andpetsc.cpp(external library failure, asserted asruntime_errorby existing tests) are left unchanged.Test plan
clang-format --dry-run --Werrorclean on touched files-Werror)fx-test dolfinx --cpp/ Python test suite not yet runAI assistance: I used Claude to draft this PR. I reviewed, edited, tested, and take responsibility for the final contribution.