improvement (messaging): add error message when the server is down

This commit is contained in:
Mickael KERJEAN
2019-03-15 01:55:49 +11:00
parent 95af619175
commit e9786ada96
+2
View File
@@ -132,6 +132,8 @@ function handle_error_response(xhr, err){
if(navigator.onLine === false){
err({message: 'Connection Lost', code: "NO_INTERNET"});
}else if(xhr.status === 0 && xhr.responseText === "") {
err({message: "Service unavailable, if the problem persist, contact your administrator", code: "INTERNAL_SERVER_ERROR"});
}else if(xhr.status === 500){
err({message: message || "Oups something went wrong with our servers", code: "INTERNAL_SERVER_ERROR"});
}else if(xhr.status === 401){