Merge branch 'feature/check_connection' into 'master'
Make client report connection issues to servers See merge request sheepitrenderfarm/client!140
This commit is contained in:
@@ -1102,12 +1102,16 @@ import okhttp3.HttpUrl;
|
|||||||
// the client cannot recover from this error (it's server side config) so exit the retry loop
|
// the client cannot recover from this error (it's server side config) so exit the retry loop
|
||||||
confirmJobReturnCode = Type.IMAGE_TOO_LARGE;
|
confirmJobReturnCode = Type.IMAGE_TOO_LARGE;
|
||||||
break retryLoop;
|
break retryLoop;
|
||||||
|
|
||||||
|
case SERVER_CONNECTION_FAILED:
|
||||||
|
confirmJobReturnCode = Type.NETWORK_ISSUE;
|
||||||
|
break;
|
||||||
|
|
||||||
case ERROR_BAD_RESPONSE:
|
case ERROR_BAD_RESPONSE:
|
||||||
// set the error and retry on next loop
|
// set the error and retry on next loop
|
||||||
confirmJobReturnCode = Type.ERROR_BAD_UPLOAD_RESPONSE;
|
confirmJobReturnCode = Type.ERROR_BAD_UPLOAD_RESPONSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// do nothing, try to do a request on the next loop
|
// do nothing, try to do a request on the next loop
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ public class Error {
|
|||||||
ERROR_NO_ROOT(2),
|
ERROR_NO_ROOT(2),
|
||||||
ERROR_BAD_RESPONSE(3),
|
ERROR_BAD_RESPONSE(3),
|
||||||
ERROR_REQUEST_FAILED(5),
|
ERROR_REQUEST_FAILED(5),
|
||||||
|
SERVER_CONNECTION_FAILED(6),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final int id;
|
private final int id;
|
||||||
|
|||||||
@@ -653,6 +653,13 @@ public class Server extends Thread {
|
|||||||
|
|
||||||
return ServerCode.UNKNOWN;
|
return ServerCode.UNKNOWN;
|
||||||
}
|
}
|
||||||
|
catch (ConnectException e) {
|
||||||
|
StringWriter sw = new StringWriter();
|
||||||
|
PrintWriter pw = new PrintWriter(sw);
|
||||||
|
e.printStackTrace(pw);
|
||||||
|
this.log.error(checkpoint, String.format("Server::HTTPSendFile Error in upload process. Exception %s stacktrace ", e.getMessage()) + sw.toString());
|
||||||
|
return ServerCode.SERVER_CONNECTION_FAILED;
|
||||||
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
PrintWriter pw = new PrintWriter(sw);
|
PrintWriter pw = new PrintWriter(sw);
|
||||||
|
|||||||
Reference in New Issue
Block a user