0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-21 08:57:57 +01:00

Log more information on AJAX failure and explicitly log when buffer is full.

This commit is contained in:
Wouter R 2016-03-11 15:49:32 +01:00
parent 4752199cfb
commit 656e37670e

View File

@ -228,6 +228,7 @@ function Printer() {
}
} else if (data.status == "fail") {
if (data.data.status == "buffer_full") {
console.log("Printer:sendPrintPart: print server reported buffer full, pausing data transmission");
//this will wait in a setTimeout loop until enough room is available and then call sendPrintPart again.
self.waitForBufferSpace(sendIndex, sendLength);
} else {
@ -248,8 +249,8 @@ function Printer() {
self.startStatusCheckInterval();
}
}
}).fail(function() {
console.log("Printer:sendPrintPart: failed");
}).fail(function(jqXHr, textStatus, errorThrown) {
console.log("Printer:sendPrintPart: failed (AJAX status: '" + textStatus + "') AJAX exception (if any):", errorThrown);
clearTimeout(self.retrySendPrintPartDelay);
self.retrySendPrintPartDelay = setTimeout(function() {
console.log("request printer:sendPrintPart failed retry");