From 90883eddb983e514fe4e5778dd2fa4cd4597953d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 5 Jan 2018 15:23:43 +0100 Subject: [PATCH] xhrErrorResponseMessage: nice message when unable to connect --- src/scripts/tutti/5_1_notifications.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/scripts/tutti/5_1_notifications.js b/src/scripts/tutti/5_1_notifications.js index 2a263d47..a857a68d 100644 --- a/src/scripts/tutti/5_1_notifications.js +++ b/src/scripts/tutti/5_1_notifications.js @@ -363,6 +363,9 @@ function getNotificationsLoop() { /* Returns a more-or-less reasonable message given an error response object. */ function xhrErrorResponseMessage(err) { + if (err.status == 0) + return 'Unable to connect to the server, check your internet connection and try again.'; + if (typeof err.responseJSON == 'undefined') return err.statusText;