catch queries that cause TypeError in [dynamicjson] #10556
Merged
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.
After we merged #10551 yesterday a new error popped up in Sentry https://shields.sentry.io/issues/5906771741?project=251614
Here's an example of a document and query that cause this
https://raw.githubusercontent.com/json-ld/json-ld.org/refs/heads/main/schemas/jsonld-schema.json
$.definitions.common.properties.['@id'].format
This particular document/query combination is an example of JSONPath-Plus/JSONPath#166 but I suspect there is a wider range of cases where we can hit this
https://github.com/JSONPath-Plus/JSONPath/blob/0c8dbcf656523fadc738cacee254ee8b96894bd7/src/jsonpath.js#L527-L528
In any case, we should catch this error and return an error badge, rather than falling over with an unhandled exception.