Vert-x 3.3.2 HTTP客户端异常处理程序

vert-x 3.3.2 http client exception handler

本文关键字:异常处理程序 客户端 Vert-x HTTP      更新时间:2023-09-26

我使用Vert-x 3.3.2.

HttpClient。exceptionHandler和HttpClientRequest。exceptionHandler抛出编译错误。

是否为这些类删除异常处理程序。

还有其他方法吗

    var client = vertx.createHttpClient(options);
    var request = client.getNow(8080, "localhost", data, function (resp)  {
            resp.bodyHandler(function (body) {
                console.log(body.toString());
            });
            resp.exceptionHandler(function(err){
                console.log("Response Exception:::"+err.getCode());
            });
    });
    request.exceptionHandler(function(Err){
        console.log("Client Exception ::: "+Err);
    });

也试过

    client.exceptionHandler(function(Err){
        console.log("Client Exception ::: "+Err);
    });

有谁能帮帮忙吗

您正在使用getNow()方法。xxxNow()方法不接收exceptionHandler:http://vertx.io/docs/vertx-core/js/_making_requests

现在方法不能接收异常处理程序。