fix(error)!: remap error codes into common reserved -400..-499 (v1.1.0)#552
Merged
Conversation
container error codes were positive constexpr ints (100-502), plus a second positive set validation_codes in schema.h, both funneled into common's error_info.code and mis-classified as Success/Invalid. Renumber all 37 codes (error_codes -400..-449, validation_codes -450..-459) into common's reserved container band, update the get_category banding classifier and is_* helpers to the new negative sub-bands, and align matching codes (value_type_mismatch, serialization_failed, ...) to common's container_system:: values. BREAKING: emitted error-code values change. Name-based consumers need no change; literal/persisted/wire consumers must update. Ships as v1.1.0 coordinated with the ecosystem (version not bumped here -- owner release). Closes #551
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.
What
Remap container's error codes from positive into common's reserved
-400..-499band, so they classify as "ContainerSystem" instead of "Success"/"Invalid".Why
error_codes.hdefined positiveconstexpr intcodes (value 100s, serialization 200s, validation 300s, resource 400s, thread_safety 500s) funneled into common's sharederror_info.code; common classifies anycode>=0as "Success" (>0as "Invalid" after #698). A second positive set,validation_codes::inschema.h, reaches common viacontainer_schema::validate_result()— the same hidden-second-surface defect found in monitoring #697.How
-400..-499:error_codes::value -400..-409, validation -410..-419, serialization -420..-429, resource -430..-439, thread_safety -440..-449;validation_codes::(schema) -450..-459. All distinct across both namespaces.get_category(int)andis_*/is_categoryhelpers to the new negative sub-bands (boundary logic re-derived for negatives; returned strings unchanged).codes::container_system::values (value_type_mismatch=-400, serialization_failed=-420, deserialization_failed=-421, invalid_format=-422).Verification
container's develop-PR CI runs no checks (all workflows are
pull_request:[main]), so local full build + tests are the authoritative gate:cmake --preset debug && cmake --build build-debug).error_codes_tests39/39 pass (incl. cross-system "ContainerSystem" classification + alignment-to-common checks + negative-band get_category boundary tests).Out of scope (follow-up recommended)
Adversarial review noted pre-existing out-of-band negative literals (
-1/-2) used as the error_info code insrc/core/serializers/{binary,json,xml,msgpack}_serializer.cppandsrc/modules/container.cppm(last touched in #538) — they classify as "Common" not "ContainerSystem". Not part of #551; worth a follow-up issue for full band hygiene.Closes #551
Part of (ecosystem error-code registry contract, kcenon/common_system#699/#701)