Class TransactionalExceptionMapper

  • All Implemented Interfaces:
    ExceptionMapper<jakarta.transaction.TransactionalException>, ExtendedExceptionMapper<jakarta.transaction.TransactionalException>

    @ApplicationScoped
    public class TransactionalExceptionMapper
    extends Object
    implements ExtendedExceptionMapper<jakarta.transaction.TransactionalException>
    Helper class to handle exceptions thrown by JTA layer. If this mapper was not registered, no WebApplicationException thrown from a transactional CDI bean would get properly mapped to corresponding response.
    Author:
    Jakub Podlesak
    • Constructor Detail

      • TransactionalExceptionMapper

        public TransactionalExceptionMapper()
    • Method Detail

      • toResponse

        public Response toResponse​(jakarta.transaction.TransactionalException exception)
        Specified by:
        toResponse in interface ExceptionMapper<jakarta.transaction.TransactionalException>
      • isMappable

        public boolean isMappable​(jakarta.transaction.TransactionalException exception)
        Specified by:
        isMappable in interface ExtendedExceptionMapper<jakarta.transaction.TransactionalException>