private Future<Void> collectResponseAttachments(Buffer responseBody) {
        if (context.isStreamingRequest()) {
            return Future.succeededFuture();
        }
        try (InputStream stream = new ByteBufInputStream(responseBody.getByteBuf())) {
            ObjectNode tree = (ObjectNode) ProxyUtil.MAPPER.readTree(stream);
            var fn = new CollectResponseAttachmentsFn(proxy, context);
            return fn.apply(tree);
        } catch (Throwable e) {
            log.warn("Can't parse JSON response body. Trace: {}. Span: {}. Error:",
                    context.getTraceId(), context.getSpanId(), e);
            return Future.failedFuture(e);
        }
    }
Called when proxy failed to receive response header from origin.
server/src/main/java/com/epam/aidial/core/server/controller/InterceptorController.java