我正在使用 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/