Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exeptionhandler not working correctly #2625

Open
Freetoplay951 opened this issue Jun 11, 2024 · 5 comments
Open

Exeptionhandler not working correctly #2625

Freetoplay951 opened this issue Jun 11, 2024 · 5 comments
Labels

Comments

@Freetoplay951
Copy link

[02:52:02] Unhandled exception in router
[02:52:03] Unhandled exception in router
[02:52:03] Unhandled exception in router
[02:52:08] Unhandled exception in router

I use:

Vertx vertex = Vertx.vertx();
Router router = Router.router(vertex);

router.route().handler(SessionHandler.create(LocalSessionStore.create(vertex)));
router.routeWithRegex("/files/.*").handler(this::handleFileRequests);
router.route().handler(BodyHandler.create()).handler(this::handleRequests);
router.route().failureHandler(failureContext -> {
    failureContext.response().setStatusCode(404).end();
});

HttpServer innerServer = vertex
        .createHttpServer()
        .requestHandler(router)
        .exceptionHandler(error -> {
        })
        .listen(port, handler -> {
        });
@Freetoplay951 Freetoplay951 changed the title Exeptionhandler not working correctly #5230 Exeptionhandler not working correctly Jun 11, 2024
@Freetoplay951
Copy link
Author

I added it here as I thought that vertx web handles routes

@tsegismont
Copy link
Contributor

What do you mean with not working? Are you talking about the exceptionHandler set on the HTTP server? This handler is not related to Vert.x Web route handlers, it's related to lower-level, connection problems.

@Freetoplay951
Copy link
Author

Imean that the error is stilöl showing up in console

@Freetoplay951
Copy link
Author

.exceptionHandler(error -> {
}) should prevent it

@tsegismont
Copy link
Contributor

So I can confirm setting an exception handler on the HTTP server will have no effect. Can you provide some reproduction steps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants