xhrErrorResponseMessage: nice message when unable to connect

This commit is contained in:
2018-01-05 15:23:43 +01:00
parent d240a979ba
commit 90883eddb9

View File

@@ -363,6 +363,9 @@ function getNotificationsLoop() {
/* Returns a more-or-less reasonable message given an error response object. */ /* Returns a more-or-less reasonable message given an error response object. */
function xhrErrorResponseMessage(err) { 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') if (typeof err.responseJSON == 'undefined')
return err.statusText; return err.statusText;