Browse Source

Handle all errors >500 (#369)

master
rozetko 5 years ago committed by Alexey Velikiy
parent
commit
32d940a914
  1. 3
      src/panel/graph_panel/services/analytic_service.ts

3
src/panel/graph_panel/services/analytic_service.ts

@ -251,9 +251,10 @@ export class AnalyticService {
} catch(error) { } catch(error) {
// xhrStatus may be one of: ('complete', 'error', 'timeout' or 'abort') // xhrStatus may be one of: ('complete', 'error', 'timeout' or 'abort')
// See: https://github.com/angular/angular.js/blob/55075b840c9194b8524627a293d6166528b9a1c2/src/ng/http.js#L919-L920 // See: https://github.com/angular/angular.js/blob/55075b840c9194b8524627a293d6166528b9a1c2/src/ng/http.js#L919-L920
if(error.xhrStatus !== 'complete' || error.status === 502) { if(error.xhrStatus !== 'complete' || error.status > 500) {
this.displayConnectionErrorAlert(); this.displayConnectionErrorAlert();
this._isUp = false; this._isUp = false;
throw new Error(`Fetching error: ${error.status}: ${error.statusText}`);
} else { } else {
this._isUp = true; this._isUp = true;
} }

Loading…
Cancel
Save