Ref: proper name of exception
This commit is contained in:
@@ -46,19 +46,19 @@ import java.util.concurrent.TimeUnit;
|
|||||||
|
|
||||||
import com.sheepit.client.Error.ServerCode;
|
import com.sheepit.client.Error.ServerCode;
|
||||||
import com.sheepit.client.Error.Type;
|
import com.sheepit.client.Error.Type;
|
||||||
import com.sheepit.client.exception.FermeException;
|
import com.sheepit.client.exception.SheepItException;
|
||||||
import com.sheepit.client.exception.FermeExceptionBadResponseFromServer;
|
import com.sheepit.client.exception.SheepItExceptionBadResponseFromServer;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoRendererAvailable;
|
import com.sheepit.client.exception.SheepItExceptionNoRendererAvailable;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoRightToRender;
|
import com.sheepit.client.exception.SheepItExceptionNoRightToRender;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoSession;
|
import com.sheepit.client.exception.SheepItExceptionNoSession;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoSpaceLeftOnDevice;
|
import com.sheepit.client.exception.SheepItExceptionNoSpaceLeftOnDevice;
|
||||||
import com.sheepit.client.exception.FermeExceptionPathInvalid;
|
import com.sheepit.client.exception.SheepItExceptionPathInvalid;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoWritePermission;
|
import com.sheepit.client.exception.SheepItExceptionNoWritePermission;
|
||||||
import com.sheepit.client.exception.FermeExceptionServerInMaintenance;
|
import com.sheepit.client.exception.SheepItExceptionServerInMaintenance;
|
||||||
import com.sheepit.client.exception.FermeExceptionServerOverloaded;
|
import com.sheepit.client.exception.SheepItExceptionServerOverloaded;
|
||||||
import com.sheepit.client.exception.FermeExceptionSessionDisabled;
|
import com.sheepit.client.exception.SheepItExceptionSessionDisabled;
|
||||||
import com.sheepit.client.exception.FermeExceptionSessionDisabledDenoisingNotSupported;
|
import com.sheepit.client.exception.SheepItExceptionSessionDisabledDenoisingNotSupported;
|
||||||
import com.sheepit.client.exception.FermeServerDown;
|
import com.sheepit.client.exception.SheepItServerDown;
|
||||||
import com.sheepit.client.hardware.cpu.CPU;
|
import com.sheepit.client.hardware.cpu.CPU;
|
||||||
import com.sheepit.client.hardware.hwid.HWIdentifier;
|
import com.sheepit.client.hardware.hwid.HWIdentifier;
|
||||||
import com.sheepit.client.os.OS;
|
import com.sheepit.client.os.OS;
|
||||||
@@ -231,11 +231,11 @@ import okhttp3.HttpUrl;
|
|||||||
this.gui.status("Requesting Job");
|
this.gui.status("Requesting Job");
|
||||||
this.renderingJob = this.server.requestJob();
|
this.renderingJob = this.server.requestJob();
|
||||||
}
|
}
|
||||||
catch (FermeExceptionNoRightToRender e) {
|
catch (SheepItExceptionNoRightToRender e) {
|
||||||
this.gui.error("User does not have enough right to render project");
|
this.gui.error("User does not have enough right to render project");
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
catch (FermeExceptionSessionDisabled e) {
|
catch (SheepItExceptionSessionDisabled e) {
|
||||||
this.gui.error(Error.humanString(Error.Type.SESSION_DISABLED));
|
this.gui.error(Error.humanString(Error.Type.SESSION_DISABLED));
|
||||||
// should wait forever to actually display the message to the user
|
// should wait forever to actually display the message to the user
|
||||||
while (shuttingdown == false) {
|
while (shuttingdown == false) {
|
||||||
@@ -246,7 +246,7 @@ import okhttp3.HttpUrl;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (FermeExceptionSessionDisabledDenoisingNotSupported e) {
|
catch (SheepItExceptionSessionDisabledDenoisingNotSupported e) {
|
||||||
this.gui.error(Error.humanString(Error.Type.DENOISING_NOT_SUPPORTED));
|
this.gui.error(Error.humanString(Error.Type.DENOISING_NOT_SUPPORTED));
|
||||||
// should wait forever to actually display the message to the user
|
// should wait forever to actually display the message to the user
|
||||||
while (shuttingdown == false) {
|
while (shuttingdown == false) {
|
||||||
@@ -257,7 +257,7 @@ import okhttp3.HttpUrl;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (FermeExceptionNoRendererAvailable e) {
|
catch (SheepItExceptionNoRendererAvailable e) {
|
||||||
this.gui.error(Error.humanString(Error.Type.RENDERER_NOT_AVAILABLE));
|
this.gui.error(Error.humanString(Error.Type.RENDERER_NOT_AVAILABLE));
|
||||||
// should wait forever to actually display the message to the user
|
// should wait forever to actually display the message to the user
|
||||||
while (shuttingdown == false) {
|
while (shuttingdown == false) {
|
||||||
@@ -268,7 +268,7 @@ import okhttp3.HttpUrl;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (FermeExceptionNoSession e) {
|
catch (SheepItExceptionNoSession e) {
|
||||||
this.log.debug("User has no session and needs to re-authenticate");
|
this.log.debug("User has no session and needs to re-authenticate");
|
||||||
ret = this.server.getConfiguration();
|
ret = this.server.getConfiguration();
|
||||||
if (ret != Error.Type.OK) {
|
if (ret != Error.Type.OK) {
|
||||||
@@ -306,12 +306,12 @@ import okhttp3.HttpUrl;
|
|||||||
this.gui.status("Requesting Job");
|
this.gui.status("Requesting Job");
|
||||||
this.renderingJob = this.server.requestJob();
|
this.renderingJob = this.server.requestJob();
|
||||||
}
|
}
|
||||||
catch (FermeException e1) {
|
catch (SheepItException e1) {
|
||||||
this.renderingJob = null;
|
this.renderingJob = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (FermeServerDown e) {
|
catch (SheepItServerDown e) {
|
||||||
int wait = ThreadLocalRandom.current().nextInt(10, 30 + 1); // max is exclusive
|
int wait = ThreadLocalRandom.current().nextInt(10, 30 + 1); // max is exclusive
|
||||||
int time_sleep = 1000 * 60 * wait;
|
int time_sleep = 1000 * 60 * wait;
|
||||||
this.gui.status(String.format("Cannot connect to the server. Please check your connectivity. Will try again at %tR",
|
this.gui.status(String.format("Cannot connect to the server. Please check your connectivity. Will try again at %tR",
|
||||||
@@ -329,7 +329,7 @@ import okhttp3.HttpUrl;
|
|||||||
this.log.removeCheckPoint(step);
|
this.log.removeCheckPoint(step);
|
||||||
continue; // go back to ask job
|
continue; // go back to ask job
|
||||||
}
|
}
|
||||||
catch (FermeExceptionServerOverloaded e) {
|
catch (SheepItExceptionServerOverloaded e) {
|
||||||
int wait = ThreadLocalRandom.current().nextInt(10, 30 + 1); // max is exclusive
|
int wait = ThreadLocalRandom.current().nextInt(10, 30 + 1); // max is exclusive
|
||||||
int time_sleep = 1000 * 60 * wait;
|
int time_sleep = 1000 * 60 * wait;
|
||||||
this.gui.status(String.format("The server is overloaded and cannot allocate a job. Will try again at %tR",
|
this.gui.status(String.format("The server is overloaded and cannot allocate a job. Will try again at %tR",
|
||||||
@@ -347,7 +347,7 @@ import okhttp3.HttpUrl;
|
|||||||
this.log.removeCheckPoint(step);
|
this.log.removeCheckPoint(step);
|
||||||
continue; // go back to ask job
|
continue; // go back to ask job
|
||||||
}
|
}
|
||||||
catch (FermeExceptionServerInMaintenance e) {
|
catch (SheepItExceptionServerInMaintenance e) {
|
||||||
int wait = ThreadLocalRandom.current().nextInt(20, 30 + 1); // max is exclusive
|
int wait = ThreadLocalRandom.current().nextInt(20, 30 + 1); // max is exclusive
|
||||||
int time_sleep = 1000 * 60 * wait;
|
int time_sleep = 1000 * 60 * wait;
|
||||||
this.gui.status(String.format("The server is under maintenance and cannot allocate a job. Will try again at %tR",
|
this.gui.status(String.format("The server is under maintenance and cannot allocate a job. Will try again at %tR",
|
||||||
@@ -365,7 +365,7 @@ import okhttp3.HttpUrl;
|
|||||||
this.log.removeCheckPoint(step);
|
this.log.removeCheckPoint(step);
|
||||||
continue; // go back to ask job
|
continue; // go back to ask job
|
||||||
}
|
}
|
||||||
catch (FermeExceptionBadResponseFromServer e) {
|
catch (SheepItExceptionBadResponseFromServer e) {
|
||||||
int wait = ThreadLocalRandom.current().nextInt(15, 30 + 1); // max is exclusive
|
int wait = ThreadLocalRandom.current().nextInt(15, 30 + 1); // max is exclusive
|
||||||
int time_sleep = 1000 * 60 * wait;
|
int time_sleep = 1000 * 60 * wait;
|
||||||
this.gui.status(String.format("Bad answer from the server. Will try again at %tR", new Date(new Date().getTime() + time_sleep)));
|
this.gui.status(String.format("Bad answer from the server. Will try again at %tR", new Date(new Date().getTime() + time_sleep)));
|
||||||
@@ -382,7 +382,7 @@ import okhttp3.HttpUrl;
|
|||||||
this.log.removeCheckPoint(step);
|
this.log.removeCheckPoint(step);
|
||||||
continue; // go back to ask job
|
continue; // go back to ask job
|
||||||
}
|
}
|
||||||
catch (FermeException e) {
|
catch (SheepItException e) {
|
||||||
this.gui.error("Client::run exception requestJob (1) " + e.getMessage());
|
this.gui.error("Client::run exception requestJob (1) " + e.getMessage());
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
PrintWriter pw = new PrintWriter(sw);
|
PrintWriter pw = new PrintWriter(sw);
|
||||||
@@ -786,18 +786,18 @@ import okhttp3.HttpUrl;
|
|||||||
return Error.Type.CAN_NOT_CREATE_DIRECTORY;
|
return Error.Type.CAN_NOT_CREATE_DIRECTORY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (FermeException e) {
|
catch (SheepItException e) {
|
||||||
gui.setRenderingProjectName("");
|
gui.setRenderingProjectName("");
|
||||||
for (String logline : configuration.filesystemHealthCheck()) {
|
for (String logline : configuration.filesystemHealthCheck()) {
|
||||||
log.debug(logline);
|
log.debug(logline);
|
||||||
}
|
}
|
||||||
if (e instanceof FermeExceptionNoSpaceLeftOnDevice) {
|
if (e instanceof SheepItExceptionNoSpaceLeftOnDevice) {
|
||||||
return Error.Type.NO_SPACE_LEFT_ON_DEVICE;
|
return Error.Type.NO_SPACE_LEFT_ON_DEVICE;
|
||||||
}
|
}
|
||||||
else if (e instanceof FermeExceptionPathInvalid) {
|
else if (e instanceof SheepItExceptionPathInvalid) {
|
||||||
return Error.Type.PATH_INVALID;
|
return Error.Type.PATH_INVALID;
|
||||||
}
|
}
|
||||||
else if (e instanceof FermeExceptionNoWritePermission) {
|
else if (e instanceof SheepItExceptionNoWritePermission) {
|
||||||
return Error.Type.NO_WRITE_PERMISSION;
|
return Error.Type.NO_WRITE_PERMISSION;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -857,17 +857,17 @@ import okhttp3.HttpUrl;
|
|||||||
return Error.Type.OK;
|
return Error.Type.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Error.Type downloadSceneFile(Job ajob_) throws FermeException {
|
protected Error.Type downloadSceneFile(Job ajob_) throws SheepItException {
|
||||||
return this.downloadFile(ajob_, ajob_.getRequiredSceneArchivePath(), ajob_.getSceneMD5(),
|
return this.downloadFile(ajob_, ajob_.getRequiredSceneArchivePath(), ajob_.getSceneMD5(),
|
||||||
String.format(LOCALE, "%s?type=job&job=%s", this.server.getPage("download-archive"), ajob_.getId()), "project");
|
String.format(LOCALE, "%s?type=job&job=%s", this.server.getPage("download-archive"), ajob_.getId()), "project");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Error.Type downloadExecutable(Job ajob) throws FermeException {
|
protected Error.Type downloadExecutable(Job ajob) throws SheepItException {
|
||||||
return this.downloadFile(ajob, ajob.getRequiredRendererArchivePath(), ajob.getRendererMD5(),
|
return this.downloadFile(ajob, ajob.getRequiredRendererArchivePath(), ajob.getRendererMD5(),
|
||||||
String.format(LOCALE, "%s?type=binary&job=%s", this.server.getPage("download-archive"), ajob.getId()), "renderer");
|
String.format(LOCALE, "%s?type=binary&job=%s", this.server.getPage("download-archive"), ajob.getId()), "renderer");
|
||||||
}
|
}
|
||||||
|
|
||||||
private Error.Type downloadFile(Job ajob, String local_path, String md5_server, String url, String download_type) throws FermeException {
|
private Error.Type downloadFile(Job ajob, String local_path, String md5_server, String url, String download_type) throws SheepItException {
|
||||||
File local_path_file = new File(local_path);
|
File local_path_file = new File(local_path);
|
||||||
String update_ui = "Downloading " + download_type;
|
String update_ui = "Downloading " + download_type;
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ import java.util.stream.Collectors;
|
|||||||
import com.sheepit.client.datamodel.SpeedTestTarget;
|
import com.sheepit.client.datamodel.SpeedTestTarget;
|
||||||
import com.sheepit.client.datamodel.SpeedTestResult;
|
import com.sheepit.client.datamodel.SpeedTestResult;
|
||||||
import com.sheepit.client.datamodel.SpeedTestTargetResult;
|
import com.sheepit.client.datamodel.SpeedTestTargetResult;
|
||||||
import com.sheepit.client.exception.FermeExceptionSessionDisabledDenoisingNotSupported;
|
import com.sheepit.client.exception.SheepItExceptionSessionDisabledDenoisingNotSupported;
|
||||||
import com.sheepit.client.hardware.hwid.HWIdentifier;
|
import com.sheepit.client.hardware.hwid.HWIdentifier;
|
||||||
import com.sheepit.client.os.Windows;
|
import com.sheepit.client.os.Windows;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -68,18 +68,18 @@ import com.sheepit.client.datamodel.JobInfos;
|
|||||||
import com.sheepit.client.datamodel.JobValidation;
|
import com.sheepit.client.datamodel.JobValidation;
|
||||||
import com.sheepit.client.datamodel.RequestEndPoint;
|
import com.sheepit.client.datamodel.RequestEndPoint;
|
||||||
import com.sheepit.client.datamodel.ServerConfig;
|
import com.sheepit.client.datamodel.ServerConfig;
|
||||||
import com.sheepit.client.exception.FermeException;
|
import com.sheepit.client.exception.SheepItException;
|
||||||
import com.sheepit.client.exception.FermeExceptionBadResponseFromServer;
|
import com.sheepit.client.exception.SheepItExceptionBadResponseFromServer;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoRendererAvailable;
|
import com.sheepit.client.exception.SheepItExceptionNoRendererAvailable;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoRightToRender;
|
import com.sheepit.client.exception.SheepItExceptionNoRightToRender;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoSession;
|
import com.sheepit.client.exception.SheepItExceptionNoSession;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoSpaceLeftOnDevice;
|
import com.sheepit.client.exception.SheepItExceptionNoSpaceLeftOnDevice;
|
||||||
import com.sheepit.client.exception.FermeExceptionPathInvalid;
|
import com.sheepit.client.exception.SheepItExceptionPathInvalid;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoWritePermission;
|
import com.sheepit.client.exception.SheepItExceptionNoWritePermission;
|
||||||
import com.sheepit.client.exception.FermeExceptionServerInMaintenance;
|
import com.sheepit.client.exception.SheepItExceptionServerInMaintenance;
|
||||||
import com.sheepit.client.exception.FermeExceptionServerOverloaded;
|
import com.sheepit.client.exception.SheepItExceptionServerOverloaded;
|
||||||
import com.sheepit.client.exception.FermeExceptionSessionDisabled;
|
import com.sheepit.client.exception.SheepItExceptionSessionDisabled;
|
||||||
import com.sheepit.client.exception.FermeServerDown;
|
import com.sheepit.client.exception.SheepItServerDown;
|
||||||
import com.sheepit.client.os.OS;
|
import com.sheepit.client.os.OS;
|
||||||
|
|
||||||
|
|
||||||
@@ -311,7 +311,7 @@ public class Server extends Thread {
|
|||||||
return Error.Type.OK;
|
return Error.Type.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Job requestJob() throws FermeException {
|
public Job requestJob() throws SheepItException {
|
||||||
this.log.debug("Server::requestJob");
|
this.log.debug("Server::requestJob");
|
||||||
String url_contents = "";
|
String url_contents = "";
|
||||||
|
|
||||||
@@ -346,15 +346,15 @@ public class Server extends Thread {
|
|||||||
int r = response.code();
|
int r = response.code();
|
||||||
if (r == HttpURLConnection.HTTP_UNAVAILABLE || r == HttpURLConnection.HTTP_CLIENT_TIMEOUT) {
|
if (r == HttpURLConnection.HTTP_UNAVAILABLE || r == HttpURLConnection.HTTP_CLIENT_TIMEOUT) {
|
||||||
this.log.error("Server::requestJob server unavailable or down: " + response);
|
this.log.error("Server::requestJob server unavailable or down: " + response);
|
||||||
throw new FermeServerDown();
|
throw new SheepItServerDown();
|
||||||
}
|
}
|
||||||
else if(response.body().contentType().toString().startsWith("text/xml") == false) {
|
else if(response.body().contentType().toString().startsWith("text/xml") == false) {
|
||||||
this.log.error("Server::requestJob bad contentType received: " + response);
|
this.log.error("Server::requestJob bad contentType received: " + response);
|
||||||
throw new FermeExceptionBadResponseFromServer();
|
throw new SheepItExceptionBadResponseFromServer();
|
||||||
}
|
}
|
||||||
else if (r != HttpURLConnection.HTTP_OK) {
|
else if (r != HttpURLConnection.HTTP_OK) {
|
||||||
this.log.error("Server::requestJob unexpected response" + response);
|
this.log.error("Server::requestJob unexpected response" + response);
|
||||||
throw new FermeException();
|
throw new SheepItException();
|
||||||
}
|
}
|
||||||
|
|
||||||
String in = response.body().string();
|
String in = response.body().string();
|
||||||
@@ -376,23 +376,23 @@ public class Server extends Thread {
|
|||||||
case JOB_REQUEST_NOJOB:
|
case JOB_REQUEST_NOJOB:
|
||||||
return null;
|
return null;
|
||||||
case JOB_REQUEST_ERROR_NO_RENDERING_RIGHT:
|
case JOB_REQUEST_ERROR_NO_RENDERING_RIGHT:
|
||||||
throw new FermeExceptionNoRightToRender();
|
throw new SheepItExceptionNoRightToRender();
|
||||||
case JOB_REQUEST_ERROR_DEAD_SESSION:
|
case JOB_REQUEST_ERROR_DEAD_SESSION:
|
||||||
throw new FermeExceptionNoSession();
|
throw new SheepItExceptionNoSession();
|
||||||
case JOB_REQUEST_ERROR_SESSION_DISABLED:
|
case JOB_REQUEST_ERROR_SESSION_DISABLED:
|
||||||
throw new FermeExceptionSessionDisabled();
|
throw new SheepItExceptionSessionDisabled();
|
||||||
case JOB_REQUEST_ERROR_SESSION_DISABLED_DENOISING_NOT_SUPPORTED:
|
case JOB_REQUEST_ERROR_SESSION_DISABLED_DENOISING_NOT_SUPPORTED:
|
||||||
throw new FermeExceptionSessionDisabledDenoisingNotSupported();
|
throw new SheepItExceptionSessionDisabledDenoisingNotSupported();
|
||||||
case JOB_REQUEST_ERROR_INTERNAL_ERROR:
|
case JOB_REQUEST_ERROR_INTERNAL_ERROR:
|
||||||
throw new FermeExceptionBadResponseFromServer();
|
throw new SheepItExceptionBadResponseFromServer();
|
||||||
case JOB_REQUEST_ERROR_RENDERER_NOT_AVAILABLE:
|
case JOB_REQUEST_ERROR_RENDERER_NOT_AVAILABLE:
|
||||||
throw new FermeExceptionNoRendererAvailable();
|
throw new SheepItExceptionNoRendererAvailable();
|
||||||
case JOB_REQUEST_SERVER_IN_MAINTENANCE:
|
case JOB_REQUEST_SERVER_IN_MAINTENANCE:
|
||||||
throw new FermeExceptionServerInMaintenance();
|
throw new SheepItExceptionServerInMaintenance();
|
||||||
case JOB_REQUEST_SERVER_OVERLOADED:
|
case JOB_REQUEST_SERVER_OVERLOADED:
|
||||||
throw new FermeExceptionServerOverloaded();
|
throw new SheepItExceptionServerOverloaded();
|
||||||
default:
|
default:
|
||||||
throw new FermeException("error requestJob: status is not ok (it's " + serverCode + ")");
|
throw new SheepItException("error requestJob: status is not ok (it's " + serverCode + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,20 +405,20 @@ public class Server extends Thread {
|
|||||||
jobData.getRenderTask().getName(), jobData.getRenderTask().getPassword(),
|
jobData.getRenderTask().getName(), jobData.getRenderTask().getPassword(),
|
||||||
jobData.getRenderTask().getSynchronous_upload().equals("1"), jobData.getRenderTask().getRendererInfos().getUpdate_method());
|
jobData.getRenderTask().getSynchronous_upload().equals("1"), jobData.getRenderTask().getRendererInfos().getUpdate_method());
|
||||||
}
|
}
|
||||||
catch (FermeException e) {
|
catch (SheepItException e) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
catch (NoRouteToHostException e) {
|
catch (NoRouteToHostException e) {
|
||||||
throw new FermeServerDown();
|
throw new SheepItServerDown();
|
||||||
}
|
}
|
||||||
catch (UnknownHostException e) {
|
catch (UnknownHostException e) {
|
||||||
throw new FermeServerDown();
|
throw new SheepItServerDown();
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
PrintWriter pw = new PrintWriter(sw);
|
PrintWriter pw = new PrintWriter(sw);
|
||||||
e.printStackTrace(pw);
|
e.printStackTrace(pw);
|
||||||
throw new FermeException("error requestJob: unknown exception " + e + " stacktrace: " + sw.toString());
|
throw new SheepItException("error requestJob: unknown exception " + e + " stacktrace: " + sw.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -487,7 +487,7 @@ public class Server extends Thread {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Error.Type HTTPGetFile(String url_, String destination_, Gui gui_, String status_) throws FermeException {
|
public Error.Type HTTPGetFile(String url_, String destination_, Gui gui_, String status_) throws SheepItException {
|
||||||
InputStream is = null;
|
InputStream is = null;
|
||||||
OutputStream output = null;
|
OutputStream output = null;
|
||||||
|
|
||||||
@@ -543,13 +543,13 @@ public class Server extends Thread {
|
|||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
File destFile = new File(destination_);
|
File destFile = new File(destination_);
|
||||||
if (Files.isWritable(destFile.getParentFile().toPath()) == false) {
|
if (Files.isWritable(destFile.getParentFile().toPath()) == false) {
|
||||||
throw new FermeExceptionNoWritePermission();
|
throw new SheepItExceptionNoWritePermission();
|
||||||
}
|
}
|
||||||
else if (destFile.getParentFile().isDirectory() == false) {
|
else if (destFile.getParentFile().isDirectory() == false) {
|
||||||
throw new FermeExceptionPathInvalid();
|
throw new SheepItExceptionPathInvalid();
|
||||||
}
|
}
|
||||||
else if (Utils.noFreeSpaceOnDisk(destFile.getParent(), log)) {
|
else if (Utils.noFreeSpaceOnDisk(destFile.getParent(), log)) {
|
||||||
throw new FermeExceptionNoSpaceLeftOnDevice();
|
throw new SheepItExceptionNoSpaceLeftOnDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2016 Laurent CLOUET
|
|
||||||
* Author Laurent CLOUET <laurent.clouet@nopnop.net>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; version 2
|
|
||||||
* of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sheepit.client.exception;
|
|
||||||
|
|
||||||
public class FermeExceptionServerInMaintenance extends FermeException {
|
|
||||||
public FermeExceptionServerInMaintenance() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public FermeExceptionServerInMaintenance(String message_) {
|
|
||||||
super(message_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
package com.sheepit.client.exception;
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
public class FermeException extends Exception {
|
public class SheepItException extends Exception {
|
||||||
public FermeException() {
|
public SheepItException() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FermeException(String message_) {
|
public SheepItException(String message_) {
|
||||||
super(message_);
|
super(message_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 Laurent CLOUET
|
||||||
|
* Author Laurent CLOUET <laurent.clouet@nopnop.net>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; version 2
|
||||||
|
* of the License.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
|
public class SheepItExceptionBadResponseFromServer extends SheepItException {
|
||||||
|
public SheepItExceptionBadResponseFromServer() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public SheepItExceptionBadResponseFromServer(String message_) {
|
||||||
|
super(message_);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
package com.sheepit.client.exception;
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
public class FermeExceptionNoRendererAvailable extends FermeException {
|
public class SheepItExceptionNoRendererAvailable extends SheepItException {
|
||||||
public FermeExceptionNoRendererAvailable() {
|
public SheepItExceptionNoRendererAvailable() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FermeExceptionNoRendererAvailable(String message_) {
|
public SheepItExceptionNoRendererAvailable(String message_) {
|
||||||
super(message_);
|
super(message_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
package com.sheepit.client.exception;
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
public class FermeExceptionSessionDisabled extends FermeException {
|
public class SheepItExceptionNoRightToRender extends SheepItException {
|
||||||
public FermeExceptionSessionDisabled() {
|
public SheepItExceptionNoRightToRender() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FermeExceptionSessionDisabled(String message_) {
|
public SheepItExceptionNoRightToRender(String message_) {
|
||||||
super(message_);
|
super(message_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
package com.sheepit.client.exception;
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
public class FermeExceptionNoSession extends FermeException {
|
public class SheepItExceptionNoSession extends SheepItException {
|
||||||
public FermeExceptionNoSession() {
|
public SheepItExceptionNoSession() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FermeExceptionNoSession(String message_) {
|
public SheepItExceptionNoSession(String message_) {
|
||||||
super(message_);
|
super(message_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
package com.sheepit.client.exception;
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
public class FermeExceptionNoSpaceLeftOnDevice extends FermeException {
|
public class SheepItExceptionNoSpaceLeftOnDevice extends SheepItException {
|
||||||
public FermeExceptionNoSpaceLeftOnDevice() {
|
public SheepItExceptionNoSpaceLeftOnDevice() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FermeExceptionNoSpaceLeftOnDevice(String message_) {
|
public SheepItExceptionNoSpaceLeftOnDevice(String message_) {
|
||||||
super(message_);
|
super(message_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
package com.sheepit.client.exception;
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
public class FermeExceptionBadResponseFromServer extends FermeException {
|
public class SheepItExceptionNoWritePermission extends SheepItException {
|
||||||
public FermeExceptionBadResponseFromServer() {
|
public SheepItExceptionNoWritePermission() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FermeExceptionBadResponseFromServer(String message_) {
|
public SheepItExceptionNoWritePermission(String message_) {
|
||||||
super(message_);
|
super(message_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
package com.sheepit.client.exception;
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
public class FermeExceptionPathInvalid extends FermeException {
|
public class SheepItExceptionPathInvalid extends SheepItException {
|
||||||
public FermeExceptionPathInvalid() {
|
public SheepItExceptionPathInvalid() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FermeExceptionPathInvalid(String message_) {
|
public SheepItExceptionPathInvalid(String message_) {
|
||||||
super(message_);
|
super(message_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
package com.sheepit.client.exception;
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
public class FermeExceptionNoWritePermission extends FermeException {
|
public class SheepItExceptionServerInMaintenance extends SheepItException {
|
||||||
public FermeExceptionNoWritePermission() {
|
public SheepItExceptionServerInMaintenance() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FermeExceptionNoWritePermission(String message_) {
|
public SheepItExceptionServerInMaintenance(String message_) {
|
||||||
super(message_);
|
super(message_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
package com.sheepit.client.exception;
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
public class FermeExceptionServerOverloaded extends FermeException {
|
public class SheepItExceptionServerOverloaded extends SheepItException {
|
||||||
public FermeExceptionServerOverloaded() {
|
public SheepItExceptionServerOverloaded() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FermeExceptionServerOverloaded(String message_) {
|
public SheepItExceptionServerOverloaded(String message_) {
|
||||||
super(message_);
|
super(message_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
package com.sheepit.client.exception;
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
public class FermeExceptionNoRightToRender extends FermeException {
|
public class SheepItExceptionSessionDisabled extends SheepItException {
|
||||||
public FermeExceptionNoRightToRender() {
|
public SheepItExceptionSessionDisabled() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FermeExceptionNoRightToRender(String message_) {
|
public SheepItExceptionSessionDisabled(String message_) {
|
||||||
super(message_);
|
super(message_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
package com.sheepit.client.exception;
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
public class FermeExceptionSessionDisabledDenoisingNotSupported extends FermeException {
|
public class SheepItExceptionSessionDisabledDenoisingNotSupported extends SheepItException {
|
||||||
public FermeExceptionSessionDisabledDenoisingNotSupported() {
|
public SheepItExceptionSessionDisabledDenoisingNotSupported() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FermeExceptionSessionDisabledDenoisingNotSupported(String message_) {
|
public SheepItExceptionSessionDisabledDenoisingNotSupported(String message_) {
|
||||||
super(message_);
|
super(message_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,12 +22,12 @@ package com.sheepit.client.exception;
|
|||||||
/**
|
/**
|
||||||
* Server down (server side error) or unreachable (client side error)
|
* Server down (server side error) or unreachable (client side error)
|
||||||
*/
|
*/
|
||||||
public class FermeServerDown extends FermeException {
|
public class SheepItServerDown extends SheepItException {
|
||||||
public FermeServerDown() {
|
public SheepItServerDown() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FermeServerDown(String message_) {
|
public SheepItServerDown(String message_) {
|
||||||
super(message_);
|
super(message_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user