better error message on login with wrong server address, fixes #15

This commit is contained in:
Jeena 2014-05-22 21:29:39 +02:00
parent 54c87e58d8
commit 89142c54c0
4 changed files with 16 additions and 4 deletions

View file

@ -175,7 +175,11 @@ TinyTinyRSS.login = function(server_url, user, password, callback) {
if(xhr.status == 200) {
callback(JSON.parse(xhr.responseText).content)
} else {
alert("error: " + xhr.status + " " + xhr.statusText)
if(xhr.status == 0) {
alert("Something went wrong, please check your credentials and the server address")
} else {
alert("error: " + xhr.status + " " + xhr.statusText)
}
}
}
}