1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 17:45:55 +00:00

expand error messages in subscribeToFeed(), provide proper error message

when URL download failed (refs #489)
This commit is contained in:
Andrew Dolgov
2012-08-21 14:09:51 +04:00
parent 9da07c8ad2
commit 23d2471c92
3 changed files with 35 additions and 13 deletions

View File

@@ -866,7 +866,7 @@ function quickAddFeed() {
var feed_url = this.attr('value').feed;
notify_progress(__("Subscribing to feed..."), true);
Element.show("feed_add_spinner");
new Ajax.Request("backend.php", {
parameters: dojo.objectToQuery(this.attr('value')),
@@ -875,13 +875,14 @@ function quickAddFeed() {
var reply = JSON.parse(transport.responseText);
var rc = parseInt(reply['result']);
var rc = reply['result'];
notify('');
Element.hide("feed_add_spinner");
console.log("GOT RC: " + rc);
switch (rc) {
switch (parseInt(rc['code'])) {
case 1:
dialog.hide();
notify_info(__("Subscribed to %s").replace("%s", feed_url));
@@ -928,7 +929,8 @@ function quickAddFeed() {
});
break;
case 5:
alert(__("Couldn't download the specified URL."));
alert(__("Couldn't download the specified URL: %s").
replace("%s", rc['message']));
break;
case 0:
alert(__("You are already subscribed to this feed."));