Skip to content

Commit

Permalink
update error message
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwizp committed Aug 4, 2020
1 parent cced959 commit 570cab1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe(`VegaParser.parseAsync`, () => {
await vp.parseAsync();

expect(
vp.error.startsWith('The input spec does not specify a "$schema":URL property')
vp.error.startsWith('Your specification requires a "$schema" field with a valid URL')
).toBeTruthy();
});
});
Expand Down
17 changes: 10 additions & 7 deletions src/plugins/vis_type_vega/public/data_model/vega_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,16 @@ export class VegaParser {
if (!spec.$schema) {
throw new Error(
i18n.translate('visTypeVega.vegaParser.inputSpecDoesNotSpecifySchemaErrorMessage', {
defaultMessage: `The input spec does not specify a {schemaParam}:URL property.
The URL for the Vega schema:
{schemaUrl}/[library]/[version].json
[library] can be vega or vega-lite
[version] defines the version of the library for which you get the schema.
This link does not need to be accessible, and will only be used for describing Vega code.`,
values: { schemaParam: '"$schema"', schemaUrl: 'https://vega.github.io/schema' },
defaultMessage: `Your specification requires a {schemaParam} field with a valid URL for
[Vega]({vegaSchemaUrl}) or
[Vega-Lite]({vegaLiteSchemaUrl}).
The URL is an identifier only. Kibana and your browser will never access this URL.`,
values: {
schemaParam: '"$schema"',
vegaLiteSchemaUrl: 'https://vega.github.io/vega-lite/docs/spec.html#top-level',
vegaSchemaUrl:
'https://vega.github.io/vega/docs/specification/#top-level-specification-properties',
},
})
);
}
Expand Down

0 comments on commit 570cab1

Please sign in to comment.