Instead of giving generic no job status, the server now give more detailed status

This commit is contained in:
Laurent Clouet
2016-03-16 14:07:42 +01:00
parent fc46062a96
commit eff4ab2198
6 changed files with 60 additions and 0 deletions

View File

@@ -35,6 +35,8 @@ import com.sheepit.client.Error.Type;
import com.sheepit.client.exception.FermeException;
import com.sheepit.client.exception.FermeExceptionNoRightToRender;
import com.sheepit.client.exception.FermeExceptionNoSession;
import com.sheepit.client.exception.FermeExceptionServerInMaintenance;
import com.sheepit.client.exception.FermeExceptionServerOverloaded;
import com.sheepit.client.exception.FermeExceptionSessionDisabled;
import com.sheepit.client.exception.FermeServerDown;
import com.sheepit.client.os.OS;
@@ -220,6 +222,30 @@ public class Client {
}
continue; // go back to ask job
}
catch (FermeExceptionServerOverloaded e) {
int wait = 15;
int time_sleep = 1000 * 60 * wait;
this.gui.status(String.format("Server is overloaded and cannot give frame to render. Will retry in %s minutes", wait));
try {
Thread.sleep(time_sleep);
}
catch (InterruptedException e1) {
return -3;
}
continue; // go back to ask job
}
catch (FermeExceptionServerInMaintenance e) {
int wait = 15;
int time_sleep = 1000 * 60 * wait;
this.gui.status(String.format("Server is in maintenance and cannot give frame to render. Will retry in %s minutes", wait));
try {
Thread.sleep(time_sleep);
}
catch (InterruptedException e1) {
return -3;
}
continue; // go back to ask job
}
catch (FermeException e) {
this.gui.error("Client::renderingManagement exception requestJob (1) " + e.getMessage());
StringWriter sw = new StringWriter();