Skip to content

Commit

Permalink
improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
shuebner committed Oct 20, 2024
1 parent be3ce9b commit 6809352
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validateRels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ function queryField(obj: any, fieldSelector: string): JSONPathQueryResult | null

if (results.length > 1) {
// see https://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions
throw new Error(`A field selector must identify a single node. "${fieldSelector}" identified ${results.map(r => r.pointer).join(", ")}.`)
throw new Error(`A field selector must identify a single node. "${fieldSelector}" identified ${results.length} nodes: ${results.map(r => r.pointer).join(", ")}.`)
}

if (results.length === 1) {
Expand Down

0 comments on commit 6809352

Please sign in to comment.