Ref: remove duplicate handle code

This commit is contained in:
Sheepit Renderfarm
2023-12-07 15:29:58 +00:00
parent 33a43ffcf8
commit 8e08b86aa1
6 changed files with 100 additions and 51 deletions

View File

@@ -19,10 +19,12 @@
package com.sheepit.client.exception;
import java.util.concurrent.ThreadLocalRandom;
/**
* Server down (server side error) or unreachable (client side error)
*/
public class SheepItServerDown extends SheepItException {
public class SheepItServerDown extends SheepItExceptionWithRequiredWait {
public SheepItServerDown() {
super();
}
@@ -30,4 +32,12 @@ public class SheepItServerDown extends SheepItException {
public SheepItServerDown(String message_) {
super(message_);
}
public String getHumanText() {
return "Cannot connect to the server. Please check your connectivity. Will try again at %tR";
}
public int getWaitDuration() {
return 1000 * 60 * ThreadLocalRandom.current().nextInt(10, 30 + 1);
}
}