This repository was archived by the owner on Feb 12, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ class Pointer<S extends object = JSONSchema> {
9292 // Crawl the object, one token at a time
9393 this . value = unwrapOrThrow ( obj ) ;
9494
95+ const errors : MissingPointerError [ ] = [ ] ;
96+
9597 for ( let i = 0 ; i < tokens . length ; i ++ ) {
9698 if ( resolveIf$Ref ( this , options , pathFromRoot ) ) {
9799 // The $ref path has changed, so append the remaining tokens to the path
@@ -120,12 +122,16 @@ class Pointer<S extends object = JSONSchema> {
120122 }
121123
122124 this . value = null ;
123- throw new MissingPointerError ( token , decodeURI ( this . originalPath ) ) ;
125+ errors . push ( new MissingPointerError ( token , decodeURI ( this . originalPath ) ) ) ;
124126 } else {
125127 this . value = this . value [ token ] ;
126128 }
127129 }
128130
131+ if ( errors . length > 0 ) {
132+ throw errors . length === 1 ? errors [ 0 ] : new AggregateError ( errors , "Multiple missing pointer errors" ) ;
133+ }
134+
129135 // Resolve the final value
130136 if ( ! this . value || ( this . value . $ref && url . resolve ( this . path , this . value . $ref ) !== pathFromRoot ) ) {
131137 resolveIf$Ref ( this , options , pathFromRoot ) ;
You can’t perform that action at this time.
0 commit comments