Can we override internal exceptions?

Hello everyone,
I am using keycloak 23 and we had to add some custom endpoints to it as part of feature request. And almost everything seems to be working correct.

But in addition to just extending keycloak api, we want to handle some of expectations which can be thrown by quarkus/jakarta.
So lets assume that we have endpoint which accept simple payload
{ "number": 1 }

where number is a numerical value. But it can happen that for some reason someone will send us through rest call number as String value, in that case we will be presented with exception InvalidFormatException which will be handled by KeycloakErrorHandler and end user will be presented with errorCode: 500 and message: “unknown_error”. Which is not perfect for us.

I tried to just create
@Provider public class InvalidFormatExceptionHandler implements ExceptionMapper<InvalidFormatException> {...}
But it is obviously not registered anywhere, so is there a way for me to register new Exception Mapper?