summaryrefslogtreecommitdiffstats
path: root/web/react/utils
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-10-06 16:17:27 -0700
committer=Corey Hulen <corey@hulen.com>2015-10-06 16:17:27 -0700
commit4345dce3b8c623a79b7d5c14bf67bc1a3c1633ed (patch)
treef49a0bfb1455ed6b38eac82a078756b1ef038a63 /web/react/utils
parentfe802fb9c4afdf27a2fb56eb472f48eb921b4de0 (diff)
downloadchat-4345dce3b8c623a79b7d5c14bf67bc1a3c1633ed.tar.gz
chat-4345dce3b8c623a79b7d5c14bf67bc1a3c1633ed.tar.bz2
chat-4345dce3b8c623a79b7d5c14bf67bc1a3c1633ed.zip
PLT-500 fixing connection msg issues
Diffstat (limited to 'web/react/utils')
-rw-r--r--web/react/utils/client.jsx12
1 files changed, 11 insertions, 1 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx
index d9f486009..6dccfcdeb 100644
--- a/web/react/utils/client.jsx
+++ b/web/react/utils/client.jsx
@@ -2,6 +2,7 @@
var BrowserStore = require('../stores/browser_store.jsx');
var TeamStore = require('../stores/team_store.jsx');
+var ErrorStore = require('../stores/error_store.jsx');
export function track(category, action, label, prop, val) {
global.window.analytics.track(action, {category: category, label: label, property: prop, value: val});
@@ -27,7 +28,16 @@ function handleError(methodName, xhr, status, err) {
msg = 'error in ' + methodName + ' status=' + status + ' statusCode=' + xhr.status + ' err=' + err;
if (xhr.status === 0) {
- e = {message: 'There appears to be a problem with your internet connection', connErrorCount: 1};
+ let errorCount = 1;
+ const oldError = ErrorStore.getLastError();
+ let connectError = 'There appears to be a problem with your internet connection';
+
+ if (oldError && oldError.connErrorCount) {
+ errorCount += oldError.connErrorCount;
+ connectError = 'We cannot reach the Mattermost service. The service may be down or misconfigured. Please contact an administrator to make sure the WebSocket port is configured properly.';
+ }
+
+ e = {message: connectError, connErrorCount: errorCount};
} else {
e = {message: 'We received an unexpected status code from the server (' + xhr.status + ')'};
}