Catching SQL ConstraintViolationException


to catch exceptions like ConstraintViolationException I implement an EmptyInterceptor because I want that my RestService returns customized exceptions.
In the interceptor I overwrite the afterTransactionCompletion(Transaction tx).
But I don’t know how to extract the exception from the transaction object and how to get the result object.
Any help?