public BackgroundException map(HttpResponse response) throws IOException {
        final S3ServiceException failure;
        if(null == response.getEntity()) {
            failure = new S3ServiceException(response.getStatusLine().getReasonPhrase());
        }
        else {
            EntityUtils.updateEntity(response, new BufferedHttpEntity(response.getEntity()));
            failure = new S3ServiceException(response.getStatusLine().getReasonPhrase(),
                    EntityUtils.toString(response.getEntity()));
        }
        failure.setResponseCode(response.getStatusLine().getStatusCode());
        if(response.containsHeader(MINIO_ERROR_CODE)) {
            failure.setErrorCode(response.getFirstHeader(MINIO_ERROR_CODE).getValue());
        }
        if(response.containsHeader(MINIO_ERROR_DESCRIPTION)) {
            failure.setErrorMessage(response.getFirstHeader(MINIO_ERROR_DESCRIPTION).getValue());
        }
        return this.map(failure);
    }
@Test
    public void testDNSFailure() {
        assertEquals("Custom.",
            new S3ExceptionMappingService().map("custom", new ServiceException("message", new UnknownHostException("h"))).getMessage());
        assertEquals("H. DNS is the network service that translates a server name to its Internet address. This error is most often caused by having no connection to the Internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventing access to the network.",
            new S3ExceptionMappingService().map("custom", new ServiceException("message", new UnknownHostException("h"))).getDetail());
    }