diff --git a/src/js/yunohost/helpers.js b/src/js/yunohost/helpers.js index 0bbefd85..51d3a74d 100644 --- a/src/js/yunohost/helpers.js +++ b/src/js/yunohost/helpers.js @@ -144,6 +144,12 @@ else if (typeof xhr.responseText !== 'undefined') { c.flash('fail', xhr.responseText); } + // 0 mean "the connexion has been closed" apparently + else if (xhr.status == 0) { + var errorMessage = xhr.status+' '+xhr.statusText; + c.flash('fail', y18n.t('error_connection_interuptted', [errorMessage])); + console.log(xhr); + } // Return HTTP error code at least else { var errorMessage = xhr.status+' '+xhr.statusText; diff --git a/src/locales/en.json b/src/locales/en.json index a9af68b3..23db2087 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -142,6 +142,7 @@ "error_select_domain": "You should indicate a domain", "error_server": "Server error", "error_server_unexpected": "Unexpected server error (%s)", + "error_connection_interuptted": "The server closed the connection instead of answering it, has nginx been restarted by error? (Error code/message: %s)", "everyone_has_access": "Everyone has access.", "experimental_warning": "Warning: this feature is experimental and not consider stable, you shouldn't be using it except if you know what you are doing.", "filesystem": "Filesystem",