Add: logger
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user