mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-09-06 01:41:00 +00:00
Update console.html
This commit is contained in:
parent
3bbad3d53e
commit
5004e64363
10
console.html
10
console.html
|
@ -51,7 +51,7 @@
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
var responseData = {
|
var responseData = {
|
||||||
"error": {
|
"error": {
|
||||||
"message": "Empty response data"
|
"message": "Unknown error"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var process_corrupted_json = function(s) {
|
var process_corrupted_json = function(s) {
|
||||||
|
@ -63,12 +63,16 @@
|
||||||
responseData = JSON.parse(s.substring(start, end));
|
responseData = JSON.parse(s.substring(start, end));
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
responseData.error.message = e.message;
|
responseData.error.message = e.message
|
||||||
|
+ "\r\nRaw response data:"
|
||||||
|
+ "\r\n" + response;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (response.trim() != "") {
|
if (response.trim() == "") {
|
||||||
|
responseData.error.message = "Received an empty response data";
|
||||||
|
} else {
|
||||||
responseData = JSON.parse(response);
|
responseData = JSON.parse(response);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user