private AmazonServiceException unmarshallError() throws Exception {
        errorResponse.setContent(new ByteArrayInputStream(BinaryUtils.copyBytesFrom(cumulation.nioBuffer())));
        return errorResponseHandler.handle(errorResponse);
    }
We've received all the error content so send it off to the error response handler to produce the service exception.
aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/internal/netty/handler/ErrorUnmarshallingHandler.java