0

Am using Vert-x 3.3.2.

HttpClient.exceptionHandler and HttpClientRequest.exceptionHandler is throwing compilation error.

Whether exception handler is removed for this classes.

Any other way to handle this.

    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);
    });

Also tried

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

Could anyone help on this.

madz
  • 168
  • 2
  • 11

1 Answers1

2

You're using getNow() method. xxxNow() methods don't receive exceptionHandler: http://vertx.io/docs/vertx-core/js/#_making_requests

IMPORTANT XXXNow methods cannot receive an exception handler.

Alexey Soshin
  • 16,718
  • 2
  • 31
  • 40