gpt4 book ai didi

javascript - vert-x 3.3.2 http客户端异常处理程序

转载 作者:行者123 更新时间:2023-12-02 03:18:11 24 4
gpt4 key购买 nike

我正在使用 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() 方法不接收异常处理程序: http://vertx.io/docs/vertx-core/js/#_making_requests

IMPORTANT XXXNow methods cannot receive an exception handler.

关于javascript - vert-x 3.3.2 http客户端异常处理程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40012296/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com