Handle when server doesn't send the expected response

This commit is contained in:
Laurent Clouet
2016-09-11 13:46:12 +02:00
parent 0d660b023b
commit 018382ac6f
4 changed files with 39 additions and 0 deletions

View File

@@ -46,7 +46,9 @@ public class Error {
CPU_NOT_SUPPORTED(18),
GPU_NOT_SUPPORTED(19),
// internal error handling
NO_SPACE_LEFT_ON_DEVICE(100),
ERROR_BAD_RESPONSE(101),
;
private final int id;
@@ -89,6 +91,7 @@ public class Error {
// internal error handling
ERROR_NO_ROOT(2),
ERROR_BAD_RESPONSE(3),
ERROR_REQUEST_FAILED(5);
private final int id;
@@ -141,6 +144,8 @@ public class Error {
public static String humanString(Type in) {
switch (in) {
case ERROR_BAD_RESPONSE:
return "Bad answer from server. It's a server side error, wait a bit an retry later.";
case NETWORK_ISSUE:
return "Could not connect to the server, please check if you have connectivity issue";
case TOO_OLD_CLIENT: