You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/evaluate/index.js
+39-21Lines changed: 39 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -26,12 +26,14 @@ const evaluate = (
26
26
if(testArrayDash(referenceToken)){
27
27
if(strictArrays){
28
28
thrownewJSONPointerIndexError(
29
-
'Invalid array index: "-" always refers to a nonexistent element during evaluation',
29
+
`Invalid array index "-" at position ${referenceTokenPosition} in ${jsonPointer}. The "-" token always refers to a nonexistent element during evaluation`,
thrownewJSONPointerKeyError(`Invalid object key: '${referenceToken}' not found`,{
69
-
jsonPointer,
70
-
referenceTokens,
71
-
referenceToken,
72
-
referenceTokenPosition,
73
-
});
77
+
thrownewJSONPointerKeyError(
78
+
`Invalid object key "${referenceToken}" at position ${referenceTokenPosition} in ${jsonPointer}: key not found in object`,
79
+
{
80
+
jsonPointer,
81
+
referenceTokens,
82
+
referenceToken,
83
+
referenceTokenPosition,
84
+
currentValue: current,
85
+
realm: realm.name,
86
+
},
87
+
);
74
88
}
75
89
76
90
returnrealm.evaluate(current,referenceToken);
77
91
}
78
92
79
-
thrownewJSONPointerTypeError(undefined,{
80
-
jsonPointer,
81
-
referenceTokens,
82
-
referenceToken,
83
-
referenceTokenPosition,
84
-
currentValue: current,
85
-
});
93
+
thrownewJSONPointerTypeError(
94
+
`Invalid reference token "${referenceToken}" at position ${referenceTokenPosition} in ${jsonPointer}: cannot be applied to a non-object/non-array value`,
0 commit comments