From 03017dfa41abe2c1e5dd5660c8ddac2edeef50e8 Mon Sep 17 00:00:00 2001 From: Synox Date: Sat, 26 Nov 2016 19:32:58 +0100 Subject: [PATCH] more debug output --- src/client-libs/index.js | 17 +++++++++++++---- src/index.html | 8 ++++++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/client-libs/index.js b/src/client-libs/index.js index 789e09e..9afe663 100644 --- a/src/client-libs/index.js +++ b/src/client-libs/index.js @@ -86,7 +86,7 @@ app.controller('MailboxController', ["$scope", "$interval", "$http", "$log", fun self.loadEmailsAsync = function (username) { $log.debug("updating mails for ", username); - $http.get(backend_url, {params: {username: username, action: "get"}}) + $http.get(backend_url, {params: {username: username}}) .then(function successCallback(response) { $log.debug("received mails for ", username); if (response.data.mails) { @@ -95,11 +95,20 @@ app.controller('MailboxController', ["$scope", "$interval", "$http", "$log", fun self.address = response.data.address; self.username = response.data.username; } else { - self.error = "There is a problem with fetching the JSON. (JSON_ERROR). Reponse: " + response.data; + self.error = { + title: "JSON_ERROR", + desc: "The JSON from the response can not be read.", + detail: response + }; + $log.error(response); } }, function errorCallback(response) { - $log.error(response); - self.error = "There is a problem with fetching the JSON. (HTTP_ERROR). Status: " + response.status; + $log.error(response, this); + self.error = { + title: "HTTP_ERROR", + desc: "There is a problem with loading the data. (HTTP_ERROR).", + detail: response + }; }); }; diff --git a/src/index.html b/src/index.html index 7d4f290..656f210 100644 --- a/src/index.html +++ b/src/index.html @@ -45,8 +45,12 @@