-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Vega] Improve error message in case of invalid $schema URL #114459
Conversation
Pinging @elastic/kibana-vis-editors (Team:VisEditors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works as expected, LGTM - left one nit
schemaVersion: schema.version, | ||
libraryVersion: libVersion, | ||
}, | ||
'The URL for the JSON "$schema" is incorrect. Correct the URL, then click Update.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would call it spec "$schema"
, as it's not necessarily JSON.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the $schema
value cannot be anything else than a URL ending with json
(source: https://github.com/vega/schema/blob/55615e9ec4d1aeae002799b90dff60aad9f31b19/parser.ts#L5 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn’t make this connection. Looks good to me then 👍
…114459) * 🐛 Catch the schema parser and provide a better error message * 🌐 Add i18n
Summary
Fixes #113899
This PR wraps the schema parser and provides a better error for the invalid case.
Checklist
Delete any items that are not applicable to this PR.