Repository navigation
Add format-agnostic rfl::ErrorKind to rfl::ErrorDetail - #70
Open
clockblocker wants to merge 3 commits into
Open
clockblocker wants to merge 3 commits into
clockblocker wants to merge 3 commits into
Conversation
clockblocker
force-pushed
the
error-kind
branch
from
November 27, 2026 08:44
133b8e7 to
1d65dc8
Compare
This was referenced Nov 27, 2026
clockblocker
added a commit
that referenced
this pull request
Nov 28, 2026
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
Adds format-agnostic
rfl::ErrorKind(enum class ErrorKind : std::uint8_t, 10 frozen values) directly onrfl::Errorandrfl::ErrorDetail, cleanly targetingmainwith zero YAML/CLI/TOML coupling.Frozen 10-Value Taxonomy
other,io_error,syntax_error,missing_field,unknown_field,duplicate_field,invalid_length,invalid_type,invalid_value,constraint_violationKey Design & ABI / Compatibility Notes
Error::kind_is stored inline onrfl::Error(sizeof(rfl::Error): 32B -> 40B, +8B due to pointer alignment) so single-error paths (includingstd::variantbacktracking) perform zero heap allocations forErrorDetailunless explicitly nested.std::variant<A, B, C, D>, AppleClang-O2):main~358–373 ms vs#70~362–366 ms (parity; zero heap-alloc penalty).main~211 ms vs#70~219–225 ms.ErrorDetail::operator==: Now compareskindalongsidepathandmessage(note for callers comparingErrorDetailinstances directly).37ae45b0):FieldVariantReadererror path to include the matched discriminator key (["circle", "radius"]).other -> invalid_valuefallback inParserTaggedUnion::get_discriminatorso untagged formats preserveother.NoFieldNamesoverflow inViewReaderWithStrippedFieldNames/ViewReaderWithDefaultAndStrippedFieldNamestoErrorKind::invalid_length.Timestamp::from_string(+Timestamp::from_reflection+HasFromReflectionMethodsupportingResult<T>) andParserWStringinvalid UTF-8 asErrorKind::invalid_value.Validator::wrap_validatedto tag errors in-place on failure (avoiding an extra move on success) and removed staleNoDuplicateKeysdoc reference.Motivation
Gives callers programmatic error classification (
missing_field,unknown_field,duplicate_field,invalid_type,invalid_value,constraint_violation, etc.) directly onrfl::Error/rfl::ErrorDetailinstead of scraping English text out ofError::what().Verification
-Wall -Werror(44/44 targeted tests after final fixes; 591/591 full suite on1d65dc8d).