better error message on login with wrong server address, fixes #15
This commit is contained in:
parent
54c87e58d8
commit
89142c54c0
4 changed files with 16 additions and 4 deletions
|
@ -186,7 +186,7 @@ App.prototype.gotUnreadFeeds = function(new_articles) {
|
|||
}
|
||||
}
|
||||
catch (e) {
|
||||
alert("Reached maximum memory by app" + e.name + " " +e.message +". We will keep working in anycase with:" + localStorage.unread_articles.length);
|
||||
alert("Reached maximum memory by app " + e.name + " " + e.message + ". We will keep working in anycase with: " + localStorage.unread_articles.length);
|
||||
}
|
||||
this.populateList();
|
||||
}
|
||||
|
|
|
@ -241,7 +241,11 @@ OwnCloud.login = function(server_url, user, password, callback) {
|
|||
if(xhr.status == 200) {
|
||||
callback(JSON.parse(xhr.responseText))
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -215,7 +215,11 @@ Pond.login = function(server_url, user, password, callback) {
|
|||
if(xhr.status == 201) {
|
||||
callback(JSON.parse(xhr.responseText))
|
||||
} else {
|
||||
alert("error: " + typeof(xhr.status) + " " + xhr.statusText + "\n\n" + xhr.responseText)
|
||||
if(xhr.status == 0) {
|
||||
alert("Something went wrong, please check your credentials and the server address")
|
||||
} else {
|
||||
alert("error: " + typeof(xhr.status) + " " + xhr.statusText + "\n\n" + xhr.responseText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -174,11 +174,15 @@ TinyTinyRSS.login = function(server_url, user, password, callback) {
|
|||
if(xhr.readyState == 4) {
|
||||
if(xhr.status == 200) {
|
||||
callback(JSON.parse(xhr.responseText).content)
|
||||
} else {
|
||||
if(xhr.status == 0) {
|
||||
alert("Something went wrong, please check your credentials and the server address")
|
||||
} else {
|
||||
alert("error: " + xhr.status + " " + xhr.statusText)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
xhr.open("POST", url, true);
|
||||
xhr.send(JSON.stringify(options));
|
||||
}
|
||||
|
|
Reference in a new issue