Show warning instead of fatal error when map-proxy is not available

This used to show a fatal error, which was too intrusive and not necessary.

This would also prevented users to navigate to another visualization on refresh since Kibana would auto-rereoute to the last shown visualization on refresh (which was the crashed tilemap).
This commit is contained in:
Thomas Neirynck 2017-01-05 02:32:44 -05:00
parent d1a42a487f
commit c0bec83a6d
2 changed files with 11 additions and 4 deletions

View file

@ -161,7 +161,6 @@ uiModules.get('kibana')
url: requestUrl,
method: 'GET'
});
}
}

View file

@ -13,8 +13,9 @@ export default function MapFactory(Private, tilemapSettings, Notifier) {
const defaultMarkerType = 'Scaled Circle Markers';
const notify = new Notifier({
location: 'Vis'
location: 'Tilemap'
});
const previousErrors = [];
const markerTypes = {
'Scaled Circle Markers': Private(VislibVisualizationsMarkerTypesScaledCirclesProvider),
@ -60,10 +61,17 @@ export default function MapFactory(Private, tilemapSettings, Notifier) {
fadeAnimation: false,
};
let url;
if (tilemapSettings.hasError()) {
notify.fatal(tilemapSettings.getError());
if (!previousErrors.includes(tilemapSettings.getError())) {
notify.warning(tilemapSettings.getError().message);
previousErrors.push(tilemapSettings.getError());
}
url = '';
} else {
url = tilemapSettings.getUrl();
}
this._createMap(options, tilemapSettings.getUrl());
this._createMap(options, url);
}