-
Notifications
You must be signed in to change notification settings - Fork 580
Closed
Labels
4.xVersion 4.xVersion 4.xMPbugSomething isn't workingSomething isn't workingwebserverwontfixThis will not be worked onThis will not be worked onworks as designed
Description
Environment Details
- Helidon Version: 4.0.0
- Helidon SE or Helidon MP MP
- JDK version:
- OS:
- Docker version (if applicable):
Problem Description
Adding a general, catch-all JAX-RS exception mapper to an app disrupts the metrics and health endpoints (and perhaps other observers' endpoints as well).
As coded in the repo, the MP QuickStart app correctly responds to the /health
and /metrics
endpoints.
If you add an exception mapper to the app, then it is invoked when the /health
and /metrics
endpoints are accessed.
Steps to reproduce
-
cd examples/quickstarts/helidon-quickstart-mp
mvn package
The preceding commands work, including running unit tests which ping the health and metrics endpoints.
-
Add the following class to the MP QuickStart app:
package io.helidon.examples.quickstart.mp; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; @Provider public class GeneralExceptionMapper implements ExceptionMapper<Exception> { @Override public Response toResponse(Exception e) { return Response.status(500).entity(e.getMessage()).build(); } }
-
Now
mvn package
fails during the/health
or/metrics
endpoint tests because the exception mapper returns 500 responses.
Metadata
Metadata
Assignees
Labels
4.xVersion 4.xVersion 4.xMPbugSomething isn't workingSomething isn't workingwebserverwontfixThis will not be worked onThis will not be worked onworks as designed
Type
Projects
Status
Closed