vertx HttpClient exception handler

78 views
Skip to first unread message

Maathavan Vinayak

unread,
Oct 13, 2016, 4:01:27 AM10/13/16
to vert.x
Am using vertx 3.3.2.
httpClient.exceptionHandler is throwing compilation error.
Whether its removed in this version and how to handle connection exceptions.
Could anyone please help on this.

Alexander Lehmann

unread,
Oct 13, 2016, 6:53:09 AM10/13/16
to vert.x
Could you please post the exception, otherwise its difficult to say.

My wild guess would be wrong Java version.
Message has been deleted

Maathavan Vinayak

unread,
Oct 13, 2016, 11:40:20 PM10/13/16
to vert.x
Dear Lehmann,

    Am using JAVA version "1.8.0_101".

    Exception is catch block is

         Caught Exception:::TypeError: request.exceptionHandler is not a function

Alexander Lehmann

unread,
Oct 15, 2016, 9:05:30 AM10/15/16
to vert.x
I think the exception handler has to be set on the request, not on the client.

If you call .exceptionHandler before .end(), you can catch the exceptions that happen during connect.

Jez P

unread,
Oct 15, 2016, 9:21:44 AM10/15/16
to vert.x
That makes sense to me. If you think you're doing it correctly please share the smallest code you have to demonstrate the problem, preferably as a project on GitHub. 

Maathavan Vinayak

unread,
Oct 17, 2016, 11:59:47 PM10/17/16
to vert.x
Thanks Lehmann,

yeah only request can handle exception. But how to handle exception in getNow()?

Kocsis Tibor

unread,
Oct 19, 2016, 5:27:29 AM10/19/16
to vert.x
According to doc:

XXXNow methods cannot receive an exception handler.

Julien Viet

unread,
Oct 20, 2016, 5:46:32 PM10/20/16
to ve...@googlegroups.com
you can do :

get(..).exceptionHandler(err -> {}).end()


-- 
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/90b2d8cf-77a3-457d-89aa-2d26cc195415%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages