Skip to content

Commit

Permalink
log json fetching error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Aug 22, 2019
1 parent 9b62177 commit d9dd17e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions News.qml
Expand Up @@ -25,10 +25,12 @@ Item {
try { try {
newsObj = JSON.parse(news.responseText); newsObj = JSON.parse(news.responseText);
} catch (error) { } catch (error) {
console.log("failed to parse posts json") console.log("failed to parse posts json with error: " + error.name);
console.log("message: " + error.message);
} }
} else { } else {
console.log("failed to fetch posts json") console.log("failed to fetch posts json with code: " + news.status);
console.log("status: " + news.statusText);
} }


if (newsObj === null) { if (newsObj === null) {
Expand Down Expand Up @@ -68,7 +70,7 @@ Item {
} }
} }


console.log("fetching recent posts JSON") console.log("fetching recent posts json")
news.open('GET', 'http://www.unvanquished.net/?json=get_recent_posts'); news.open('GET', 'http://www.unvanquished.net/?json=get_recent_posts');
news.send(); news.send();
} }
Expand Down

0 comments on commit d9dd17e

Please sign in to comment.