You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By defining a full override of the default handler (html) for Throwable class, trying to still leverage the already provided handlers for e.g.: javax.ws.rs.NotFoundException, I am having inconsistencies through dev and prod.
Expected behavior
Consistent behavior through environments. I.e.:
404 outputs 404 page in both dev and prod
500 outputs 500 page in both dev and prod.
Actual behavior
500 page is always shown in prod.
How to Reproduce?
Adding the following mapper to the codebase:
import io.quarkus.arc.Priority;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
@Priority(10_000)
@Provider
public class InternalServerErrorMapper implements ExceptionMapper<Throwable> {
@Override
public Response toResponse(final Throwable exception) {
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
}
}
With these sample endpoints:
@GET
@Path("throw500")
@Produces(MediaType.APPLICATION_JSON)
public LocalDateTime time() {
return LocalDateTime.of(2022, Month.NOVEMBER, 31, 13, 10);
}
@GET
@Path("throw404")
@Produces(MediaType.APPLICATION_JSON)
public Slot okSlot() {
throw new NotFoundException();
}
Will override the Internal Server Error page in dev but not the 404 on dev i.e.,
Accessing /throw404 will show the 404 page.
Accessing /throw500 will show a blank page but with a 500 in the network call as expected.
Generating the prod image:
Accessing /throw404 will show a blank page but with a 500 in the network call and this is not expected. We are expecting a 404.
Accessing /throw500 will show a blank page but with a 500 in the network call as expected.
Output of uname -a or ver
Irrelevant
Output of java -version
openjdk 19.0.1 2022-10-18
GraalVM version (if different from Java)
Irrelevant
Quarkus version or git rev
2.15.2.Final
Build tool (ie. output of mvnw --version or gradlew --version)
Irrelevant
Additional information
N/A
The text was updated successfully, but these errors were encountered:
Describe the bug
By defining a full override of the default handler (html) for
Throwable
class, trying to still leverage the already provided handlers for e.g.:javax.ws.rs.NotFoundException
, I am having inconsistencies through dev and prod.Expected behavior
Consistent behavior through environments. I.e.:
404 outputs 404 page in both dev and prod
500 outputs 500 page in both dev and prod.
Actual behavior
500 page is always shown in prod.
How to Reproduce?
Adding the following mapper to the codebase:
With these sample endpoints:
Will override the Internal Server Error page in dev but not the 404 on dev i.e.,
Accessing /throw404 will show the 404 page.
Accessing /throw500 will show a blank page but with a 500 in the network call as expected.
Generating the prod image:
Accessing /throw404 will show a blank page but with a 500 in the network call and this is not expected. We are expecting a 404.
Accessing /throw500 will show a blank page but with a 500 in the network call as expected.
Output of
uname -a
orver
Irrelevant
Output of
java -version
openjdk 19.0.1 2022-10-18
GraalVM version (if different from Java)
Irrelevant
Quarkus version or git rev
2.15.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Irrelevant
Additional information
N/A
The text was updated successfully, but these errors were encountered: