Open FulaiZhang-cn opened 5 years ago
exceptionHandler
is for exceptions thrown by the stream, i.e. a closed connection (SocketException
), not for exceptions thrown by your user-supplied handler. If you'd like to handle those exceptions wrap your handler in a try-catch.
here is reproduce code:
import io.vertx.core.AbstractVerticle; import io.vertx.core.Vertx; import io.vertx.core.buffer.Buffer; import io.vertx.core.http.HttpClient; import io.vertx.core.http.HttpServer; import io.vertx.core.http.ServerWebSocket; import io.vertx.ext.web.Router; import io.vertx.ext.web.RoutingContext;
public class ReproduceWebSocketException extends AbstractVerticle {
}
there have a exception throwed in :
socket.handler(buff->{ System.out.println("got buffer:" + buff.toString());
while I am debugging source code, found that
InboundBuffer<Buffer> pending
inWebSocketImplBase
doesn't setup exceptionHandler. so I think this is a bug.