cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose MarĂ­a Zaragoza <demablo...@gmail.com>
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 <raul@cantara.com>:
> 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 http://cxf.apache.org/docs/validationfeature.html. exception should be
javax.validation.ConstraintViolationException or
javax.validation.ValidationException

How are you setting up Bean Validation feature  ?



>
> Thanks,
>
> Raul

Mime
View raw message