Merged
Conversation
This is what downstream users will expect and allows for sequant::Exception to be caught in general catch(const std::exception &) clauses.
The important trait of these functions is that they will throw on invalid input rather than performing partial parses or silently returning a default value on invalid input.
Fixes ValeevGroup#471 (first half)
The change is necessary as 4deff46 has changed the order in which external_indices(…) returns indices. These instances have been missed before due to invalid CLI parameter handling when executing the integration tests along with the tests not failing upon those illegal parameters. These issues have been addressed in dce831f and 13296ec respectively. Fixes ValeevGroup#471 (second half)
ajay-mk
reviewed
Jan 30, 2026
b342beb to
e9ccd55
Compare
e9ccd55 to
e06ad9c
Compare
evaleev
reviewed
Jan 31, 2026
| public: | ||
| Exception(const std::string& str) : msg_(str) {} | ||
| virtual std::string_view what() const { return msg_; } | ||
| virtual const char* what() const noexcept { return msg_.data(); } |
Member
There was a problem hiding this comment.
not clear to me why not use the safer alternative to C "strings"?
Collaborator
Author
There was a problem hiding this comment.
Because std::exception defines the interface for what() to return const char *. Hence, we can't change that (in this way) here, unless I am missing something 👀
Besides, general wisdom typically states that one shouldn't return views (as that can create lifetime issues) - only take them as input parameters… Admittedly, this doesn't apply to this case as a C string is effectively also a kind of view 🤷
Member
|
seems to fix all issues spotted in #471 ... ? |
evaleev
approved these changes
Jan 31, 2026
Collaborator
Author
I think so, yes |
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.
Uh oh!
There was an error while loading. Please reload this page.