private AmazonServiceException doEnhancedUnmarshall(EnhancedJsonErrorUnmarshaller unmarshaller,
                                                        String errorCode,
                                                        HttpResponse response,
                                                        byte[] rawContent) throws Exception {
        if (rawContent == null) {
            rawContent = new byte[0];
        }

        JsonParser jsonParser = jsonFactory.createParser(rawContent);
        JsonUnmarshallerContext unmarshallerContext = new JsonUnmarshallerContextImpl(
                jsonParser, simpleTypeUnmarshallers, customTypeUnmarshallers, response);
        try {
            return unmarshaller.unmarshallFromContext(unmarshallerContext);
        } catch (JsonParseException e) {
            if (LOG.isDebugEnabled()) {
                LOG.debug(String.format("Received response with error code '%s', but response body did not contain " +
                                        "valid JSON. Treating it as an empty object.", errorCode), e);
            }
            // This is to keep consistent with the previous behavior
            JsonParser emptyParser = jsonFactory.createParser("{}");
            unmarshallerContext = new JsonUnmarshallerContextImpl(
                    emptyParser, simpleTypeUnmarshallers, customTypeUnmarshallers, response);
            return unmarshaller.unmarshallFromContext(unmarshallerContext);
        }
    }
Create an AmazonServiceException using the chain of unmarshallers. This method will never
return null, it will always return a valid AmazonServiceException

@param errorCode
           Error code to find an appropriate unmarshaller
@param response
           The HTTP response
@param jsonNode
           JsonNode of HTTP response
@param rawContent
           The raw bytes of the HTTP response content
@return AmazonServiceException
aws-java-sdk-core/src/main/java/com/amazonaws/http/JsonErrorResponseHandler.java