Skip to content

Add machine-readable Error::code() and ErrorDetail for validator errors - #120

Open
clockblocker wants to merge 3 commits into
error-kindfrom
error-detail-code
Open

clockblocker wants to merge 3 commits into
error-kindfrom
error-detail-code

Conversation

@clockblocker

Copy link
Copy Markdown
Owner

Summary

Stacked on #70 (error-kind). Adds machine-readable Error::code() (zero-allocation compact BuiltinErrorCode packing for built-in validators, zero sizeof(Error) growth) and ErrorDetail metadata for custom validators and structured error reporting.

  • Compact BuiltinErrorCode encoding preserves zero-allocation and zero sizeof(Error) overhead for all built-in validators (Minimum, Maximum, ExclusiveMinimum, ExclusiveMaximum, Size, CodePoints, Pattern, Email, OneOf, AllOf, AnyOf, EqualTo, NotEqualTo, etc.).
  • wrap_error / wrap_field_error preserve Error::code() without extra allocations.
  • Fixes OneOf.hpp .and_then().or_else() composition and MapReader.hpp exception-safe key validation preserving error codes.
  • Clean standalone upstream extraction: excludes fork-only YAML SourceLocation and ErrorDetail::causes.

Verification

  • Full CTest suite under -Wall -Werror + REFLECTCPP_STRICT_WARNINGS=ON: 646/646 passed.
  • Passed Neon High Judge review (APPROVE).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant