logger.info("Handling error response " + responseType);
if(responseType.equals("")) {
throw new ServiceException("No valid response from server.");
} else if( responseType.startsWith(ResponseType.BADAUTH.toString()) ) {
throw new AuthenticationException("The submitted credentials are not valid.");
} else if (responseType.startsWith(ResponseType.BANNED.toString()) ) {
throw new ServiceException("You were banned from the service because of a protocol violation.");
} else if( responseType.startsWith(ResponseType.BADTIME.toString()) ) {
throw new ServiceException("The timestamp provided seems not valid. Try to correct the system clock.");
} else if( responseType.startsWith(ResponseType.FAILED.toString()) ) {
throw new ServiceException(responseType.substring(7));
} else if (responseType.startsWith(ResponseType.BADSESSION.toString()) ) {
throw new SessionExpiredException("Your session has expired please re-handshake service.");