diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx index f72d2c0e6ead..0cb24be445c6 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx @@ -384,14 +384,11 @@ export class VectorLayer extends AbstractLayer { join, propertiesMap, }; - } catch (e) { - if (!(e instanceof DataRequestAbortError)) { - onLoadError(sourceDataId, requestToken, `Join error: ${e.message}`); + } catch (error) { + if (!(error instanceof DataRequestAbortError)) { + onLoadError(sourceDataId, requestToken, `Join error: ${error.message}`); } - return { - dataHasChanged: true, - join, - }; + throw error; } } @@ -430,7 +427,7 @@ export class VectorLayer extends AbstractLayer { }; } - async _performInnerJoins( + _performInnerJoins( sourceResult: SourceResult, joinStates: JoinState[], updateSourceData: DataRequestContext['updateSourceData'] @@ -538,9 +535,7 @@ export class VectorLayer extends AbstractLayer { if (!(error instanceof DataRequestAbortError)) { onLoadError(dataRequestId, requestToken, error.message); } - return { - refreshed: false, - }; + throw error; } } @@ -646,6 +641,7 @@ export class VectorLayer extends AbstractLayer { if (!(error instanceof DataRequestAbortError)) { onLoadError(dataRequestId, requestToken, error.message); } + throw error; } } @@ -736,6 +732,7 @@ export class VectorLayer extends AbstractLayer { stopLoading(dataRequestId, requestToken, formatters, nextMeta); } catch (error) { onLoadError(dataRequestId, requestToken, error.message); + throw error; } } @@ -757,19 +754,26 @@ export class VectorLayer extends AbstractLayer { if (this.isLoadingBounds()) { return; } - await this._syncSourceStyleMeta(syncContext, source, style); - await this._syncSourceFormatters(syncContext, source, style); - const sourceResult = await this._syncSource(syncContext, source, style); - if ( - !sourceResult.featureCollection || - !sourceResult.featureCollection.features.length || - !this.hasJoins() - ) { - return; - } - const joinStates = await this._syncJoins(syncContext, style); - await this._performInnerJoins(sourceResult, joinStates, syncContext.updateSourceData); + try { + await this._syncSourceStyleMeta(syncContext, source, style); + await this._syncSourceFormatters(syncContext, source, style); + const sourceResult = await this._syncSource(syncContext, source, style); + if ( + !sourceResult.featureCollection || + !sourceResult.featureCollection.features.length || + !this.hasJoins() + ) { + return; + } + + const joinStates = await this._syncJoins(syncContext, style); + this._performInnerJoins(sourceResult, joinStates, syncContext.updateSourceData); + } catch (error) { + if (!(error instanceof DataRequestAbortError)) { + throw error; + } + } } _getSourceFeatureCollection() {