cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose MarĂ­a Zaragoza <>
Subject Re: customize error messages for bad input requests
Date Thu, 10 Apr 2014 19:49:31 GMT
2014-04-10 20:55 GMT+02:00 Raul Acevedo <>:
> On 2014-04-09 21:35, Sergey Beryozkin wrote:
>> Can you try and manage it at JAX-RS Bean Validation level,
>> specifically, by adding a ValidationException mapper or at the very
>> least a RuntimeException mapper ?
> CXF doesn't throw ValidationException when it tries to bind a string to an
> integer; it throws ClientErrorException, so creating
> ExceptionHandler<ClientErrorException> works, except that exception is too
> general, it doesn't tell me that the error was trying to bind input
> arguments, or what input arguments failed.  It's documented as "A base
> runtime application exception indicating a client request error (HTTP {@code
> 4xx} status codes)."
> So in theory ClientErrorException can happen for a wide variety of reasons;
> I can't use it determine if there was an input error.
> Is there some other way of customizing the response when CXF can't bind
> input arguments?

According exception should be
javax.validation.ConstraintViolationException or

How are you setting up Bean Validation feature  ?

> Thanks,
> Raul

View raw message