Improve plugin version mismatch error message (#25774)

Closes #16796

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This commit is contained in:
Tyler Smalley 2018-11-28 11:59:52 -08:00 committed by GitHub
parent 7f274efb1c
commit e09f6906ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -61,7 +61,6 @@ export function assertVersion(settings) {
const actual = cleanVersion(settings.plugins[0].kibanaVersion);
const expected = cleanVersion(settings.version);
if (!versionSatisfies(actual, expected)) {
throw new Error (`Incorrect Kibana version in plugin [${settings.plugins[0].name}]. ` +
`Expected [${expected}]; found [${actual}]`);
throw new Error(`Plugin ${settings.plugins[0].name} [${actual}] is incompatible with Kibana [${expected}]`);
}
}

View file

@ -81,7 +81,7 @@ describe('kibana cli', function () {
it('should throw an error if plugin kibanaVersion does not match kibana version', function () {
settings.plugins[0].kibanaVersion = '1.2.3.4';
expect(() => assertVersion(settings)).toThrow(/incorrect kibana version/i);
expect(() => assertVersion(settings)).toThrow(/incompatible with Kibana/i);
});
it('should not throw an error if plugin kibanaVersion matches kibana version', function () {
@ -99,7 +99,7 @@ describe('kibana cli', function () {
it('should ignore version info after the dash in checks on invalid version', function () {
settings.plugins[0].kibanaVersion = '2.0.0-foo-bar-version-1.2.3';
expect(() => assertVersion(settings)).toThrow(/incorrect kibana version/i);
expect(() => assertVersion(settings)).toThrow(/incompatible with Kibana/i);
});
});