0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-22 01:07:56 +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") { } else if (data.status == "fail") {
if (data.data.status == "buffer_full") { 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. //this will wait in a setTimeout loop until enough room is available and then call sendPrintPart again.
self.waitForBufferSpace(sendIndex, sendLength); self.waitForBufferSpace(sendIndex, sendLength);
} else { } else {
@ -248,8 +249,8 @@ function Printer() {
self.startStatusCheckInterval(); self.startStatusCheckInterval();
} }
} }
}).fail(function() { }).fail(function(jqXHr, textStatus, errorThrown) {
console.log("Printer:sendPrintPart: failed"); console.log("Printer:sendPrintPart: failed (AJAX status: '" + textStatus + "') AJAX exception (if any):", errorThrown);
clearTimeout(self.retrySendPrintPartDelay); clearTimeout(self.retrySendPrintPartDelay);
self.retrySendPrintPartDelay = setTimeout(function() { self.retrySendPrintPartDelay = setTimeout(function() {
console.log("request printer:sendPrintPart failed retry"); console.log("request printer:sendPrintPart failed retry");