[fix] handle super cryptic error situation

This commit is contained in:
Laurent Peuch 2018-12-31 13:34:57 +01:00
parent d2b0b0207d
commit 4884bff617
2 changed files with 7 additions and 0 deletions

View file

@ -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;

View file

@ -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",