From b69d186563a34a04ef647af79b28c33693a64b69 Mon Sep 17 00:00:00 2001 From: rozetko Date: Fri, 5 Apr 2019 16:15:10 +0300 Subject: [PATCH] Error 500 should not set disconnect state #229 (#237) --- src/panel/graph_panel/services/analytic_service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/panel/graph_panel/services/analytic_service.ts b/src/panel/graph_panel/services/analytic_service.ts index e7b114d..fd3aa34 100644 --- a/src/panel/graph_panel/services/analytic_service.ts +++ b/src/panel/graph_panel/services/analytic_service.ts @@ -224,7 +224,9 @@ export class AnalyticService { this._isUp = true; return response.data; } catch(error) { - if(error.xhrstatus === 'error' || error.status !== 200) { + // 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 + if(error.xhrstatus !== 'complete') { this.displayConnectionErrorAlert(); this._isUp = false; } else {