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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.7
    • Fix Version/s: 3.0.0-milestone2, 2.7.10
    • Component/s: JAX-RS
    • Labels:
      None
    • Estimated Complexity:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: