Source:
<code>public void handleError(HttpCommand command, HttpResponse response) { byte[] data = closeClientButKeepContentStream(response); String message = data != null ? new String(data) : null; Exception exception = message != null ? new HttpResponseException(command, response, message) : new HttpResponseException(command, response); message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), response.getStatusLine()); switch (response.getStatusCode()) { case 400: if (message.contains("RESOURCE_NOT_FOUND") || message.contains("OPERATION_NOT_SUPPORTED")) { exception = new ResourceNotFoundException(message, exception); } else if (message.contains("INVALID_INPUT_DATA") || message.contains("ORGANIZATION_NOT_VERIFIED") || (message.contains("SYSTEM_ERROR") && !message.contains("RETRYABLE_SYSTEM_ERROR")) || message .contains("CPU_SPEED_NOT_AVAILABLE") || message.contains("CONFIGURATION_NOT_SUPPORTED")) { exception = new IllegalStateException(message, exception); } else if (message.contains("RESOURCE_BUSY") || message.contains("UNEXPECTED_ERROR")) { exception = new ResourceNotFoundException(message, exception); } else if (message.contains("NAME_NOT_UNIQUE")) { exception = new ResourceAlreadyExistsException(message, exception); } break; case 401: exception = new AuthorizationException(message, exception); break; case 403: exception = new AuthorizationException(message, exception); break; case 404: <START> exception = new IllegalStateException(message, exception); <END> break; } command.setException(exception); }</code><technical_language>A malformed URL in a request is represented IllegalArgumentException. Illegal sates more for 409 (Conflict) errors</technical_language>

Target:
public void handleError(HttpCommand command, HttpResponse response) { byte[] data = closeClientButKeepContentStream(response); String message = data != null ? new String(data) : null; Exception exception = message != null ? new HttpResponseException(command, response, message) : new HttpResponseException(command, response); message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), response.getStatusLine()); switch (response.getStatusCode()) { case 400: if (message.contains("RESOURCE_NOT_FOUND")) { exception = new ResourceNotFoundException(message, exception); } else if (message.contains("OPERATION_NOT_SUPPORTED")) { exception = new UnsupportedOperationException(message, exception); } else if (message.contains("RESOURCE_BUSY")) { exception = new ConcurrentModificationException(message, exception); } else if (message.contains("RESOURCE_LOCKED")) { exception = new IllegalStateException(message, exception); } else if (message.contains("NAME_NOT_UNIQUE")) { exception = new ResourceAlreadyExistsException(message, exception); } else if (message.contains("UNEXPECTED_ERROR") || message.contains("RETRYABLE_SYSTEM_ERROR") || message.contains("SYSTEM_ERROR")) { break; } else { exception = new IllegalArgumentException(message, exception); } break; case 401: exception = new AuthorizationException(message, exception); break; case 403: exception = new AuthorizationException(message, exception); break; case 404: exception = new IllegalArgumentException(message, exception); break; } command.setException(exception); }