Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5348

Exception mappers implementing ExceptionMapper through an abstract class are not mapped to the declared exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.7.7
    • 3.0.0-milestone2, 2.7.10
    • JAX-RS
    • None
    • Unknown

    Description

      If we consider the following exception mapper, all Throwables will be mapped instead of only the SomeClientExceptions :

      @Provider
      public class SomeClientExceptionMapper extends AbstractBadRequestExceptionMapper<SomeClientException> {}
      
      abstract class AbstractBadRequestExceptionMapper<T extends Throwable> implements ExceptionMapper<T> {
      
          @Override
          public Response toResponse(T exception) {
              return Response.status(Status.BAD_REQUEST).entity(exception.getMessage()).build();
          }
      }
      

      Please find attached, a sample project with some ITs showing the problem.

      Attachments

        Issue Links

          Activity

            People

              sergey_beryozkin Sergey Beryozkin
              fabien.thouny Fabien Thouny
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: