Add: logger

This commit is contained in:
cutls
2019-10-31 00:30:26 +09:00
parent 9f9e4d6d6e
commit 4f7eb88a13
34 changed files with 910 additions and 311 deletions

View File

@@ -148,7 +148,12 @@
headers: { "content-type": "application/json" }
})
.then(function(response) {
return response.json();
if (!response.ok) {
response.text().then(function(text) {
setLog(response.url, response.status, text);
});
}
return response.json();
})
.catch(function(error) {
todo(error);
@@ -215,7 +220,12 @@
headers: { "content-type": "application/json" }
})
.then(function(response) {
return response.json();
if (!response.ok) {
response.text().then(function(text) {
setLog(response.url, response.status, text);
});
}
return response.json();
})
.catch(function(error) {
todo(error);