Skip to content
This repository was archived by the owner on Mar 28, 2021. It is now read-only.

Commit 03017df

Browse files
committed
more debug output
1 parent ba02ed8 commit 03017df

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

src/client-libs/index.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ app.controller('MailboxController', ["$scope", "$interval", "$http", "$log", fun
8686

8787
self.loadEmailsAsync = function (username) {
8888
$log.debug("updating mails for ", username);
89-
$http.get(backend_url, {params: {username: username, action: "get"}})
89+
$http.get(backend_url, {params: {username: username}})
9090
.then(function successCallback(response) {
9191
$log.debug("received mails for ", username);
9292
if (response.data.mails) {
@@ -95,11 +95,20 @@ app.controller('MailboxController', ["$scope", "$interval", "$http", "$log", fun
9595
self.address = response.data.address;
9696
self.username = response.data.username;
9797
} else {
98-
self.error = "There is a problem with fetching the JSON. (JSON_ERROR). Reponse: " + response.data;
98+
self.error = {
99+
title: "JSON_ERROR",
100+
desc: "The JSON from the response can not be read.",
101+
detail: response
102+
};
103+
$log.error(response);
99104
}
100105
}, function errorCallback(response) {
101-
$log.error(response);
102-
self.error = "There is a problem with fetching the JSON. (HTTP_ERROR). Status: " + response.status;
106+
$log.error(response, this);
107+
self.error = {
108+
title: "HTTP_ERROR",
109+
desc: "There is a problem with loading the data. (HTTP_ERROR).",
110+
detail: response
111+
};
103112
});
104113
};
105114

src/index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@
4545
<div class="container min-height">
4646
<div ng-if="$ctrl.error" class="alert alert-danger" role="alert">
4747
<p><strong>Sorry, there was a problem. </strong></p>
48-
<p> {{$ctrl.error}} </p>
49-
<p> Make sure the backend works corrently using the developer tools of your web browser. </p>
48+
<p> {{$ctrl.error.desc}} </p>
49+
<p>
50+
<pre>{{$ctrl.error.detail|json}}</pre>
51+
</p>
52+
<p> If you are the developer you might want to check the developer tools console of your web
53+
browser. </p>
5054
</div>
5155

5256
<p ng-if="!$ctrl.username">

0 commit comments

Comments
 (0)