Add SchemaBrokenReferenceError to distinguish broken references after transformation#919
Open
staging-devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Open
Add SchemaBrokenReferenceError to distinguish broken references after transformation#919staging-devin-ai-integration[bot] wants to merge 2 commits intomainfrom
staging-devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Conversation
- Created new SchemaBrokenReferenceError class that extends SchemaReferenceError - Updated default SchemaTransformRule::rereference to throw SchemaBrokenReferenceError - Updated test to catch the more specific error type - This allows distinguishing broken references from other reference errors Co-Authored-By: unknown <>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Resolved conflicts by accepting main branch's implementation of SchemaBrokenReferenceError which uses inherited constructors instead of a custom constructor with hardcoded message. Co-Authored-By: unknown <>
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.
Add SchemaBrokenReferenceError to distinguish broken references after transformation
Summary
This PR introduces a new
SchemaBrokenReferenceErrorexception class as a subclass ofSchemaReferenceError. The default implementation ofSchemaTransformRule::rereferencenow throws this more specific error type instead of the genericSchemaReferenceError.This change allows users of the transformer API to distinguish between references that break during transformation versus other types of reference errors, making error handling more precise and debugging easier.
Changes:
SchemaBrokenReferenceErrorclass injsonschema_error.hthat extendsSchemaReferenceErrorSchemaTransformRule::rereferenceintransformer.ccto throw the new error typerereference_not_fixed_refto catch the more specific error typeBackward Compatibility: Since
SchemaBrokenReferenceErroris a subclass ofSchemaReferenceError, existing code that catchesSchemaReferenceErrorwill continue to work without modification.Review & Testing Checklist for Human
rereference_not_fixed_refTest Plan
maketo verify all tests passNotes
SOURCEMETA_CORE_JSONSCHEMA_EXPORT