I've tried registering custom exception mappers in multiple ways:
@Provider
public class ConstraintViolationMapper implements ExceptionMapper<ConstraintViolationException> {
@Override
public Response toResponse(ConstraintViolationException exception) {
...
}
}
@Provider
public class ConstraintViolationMapper implements ExceptionMapper<ResteasyViolationException> {
@Override
public Response toResponse(ResteasyViolationException exception) {
...
}
}
@Provider
public class ConstraintViolationMapper implements ExceptionMapper<ValidationException> {
@Override
public Response toResponse(ValidationException exception) {
...
}
}
But all that happens is the default behaviour by the ResteasyViolationExceptionMapper. My custom ExceptionMapper is never called. I don't know what else to try.
I don't know why it didn't work when I first tried it, but this works