@@ -217,7 +217,7 @@ function getObjectDiff(obj1: any, obj2: any) {
217217 return diff ;
218218}
219219
220- const noopSetLoading = ( loading : boolean ) => { } ;
220+ const noopSetLoadingCallback = ( loading : boolean ) => { } ;
221221
222222/**
223223 * A PivotRequester listens for changes on the appState and viewport and
@@ -241,12 +241,12 @@ export class PivotRequester {
241241 pendingOffset : number ;
242242 pendingLimit : number ;
243243 errorCallback ?: ( e : Error ) => void ;
244- setLoading : ( loading : boolean ) => void ;
244+ setLoadingCallback : ( loading : boolean ) => void ;
245245
246246 constructor (
247247 stateRef : oneref . StateRef < AppState > ,
248248 errorCallback ?: ( e : Error ) => void ,
249- setLoading ?: ( loading : boolean ) => void
249+ setLoadingCallback ?: ( loading : boolean ) => void
250250 ) {
251251 this . pendingQueryRequest = null ;
252252 this . currentQueryView = null ;
@@ -255,7 +255,7 @@ export class PivotRequester {
255255 this . pendingOffset = 0 ;
256256 this . pendingLimit = 0 ;
257257 this . errorCallback = errorCallback ;
258- this . setLoading = setLoading || noopSetLoading ;
258+ this . setLoadingCallback = setLoadingCallback || noopSetLoadingCallback ;
259259
260260 addStateChangeListener ( stateRef , ( _ ) => {
261261 this . onStateChange ( stateRef ) ;
@@ -270,7 +270,7 @@ export class PivotRequester {
270270 stateRef : oneref . StateRef < AppState > ,
271271 queryView : QueryView
272272 ) : Promise < PagedDataView > {
273- this . setLoading ( true ) ;
273+ this . setLoadingCallback ( true ) ;
274274 const appState : AppState = mutableGet ( stateRef ) ;
275275 const viewState = appState . viewState ;
276276 const viewParams = viewState . viewParams ;
@@ -299,7 +299,7 @@ export class PivotRequester {
299299 . set ( "dataView" , dataView ) as ViewState
300300 )
301301 ) ;
302- this . setLoading ( false ) ;
302+ this . setLoadingCallback ( false ) ;
303303 return dataView ;
304304 } ) ;
305305 return dreq ;
@@ -377,7 +377,7 @@ export class PivotRequester {
377377 err . message ,
378378 err . stack
379379 ) ;
380- this . setLoading ( false ) ;
380+ this . setLoadingCallback ( false ) ;
381381 // TODO:
382382 // remoteErrorDialog("Error constructing view", err.message); // Now let's try and restore to previous view params:
383383 oneref . update (
@@ -388,6 +388,10 @@ export class PivotRequester {
388388 . update ( "loadingTimer" , ( lt ) => lt . stop ( ) )
389389 )
390390 ) ;
391+ if ( this . errorCallback ) {
392+ this . errorCallback ( err instanceof Error ? err : new Error ( err ) ) ;
393+ }
394+
391395 } ) ;
392396 const ltUpdater = util . pathUpdater < AppState , Timer > ( stateRef , [
393397 "viewState" ,
0 commit comments