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

Throw error in exceptionmapper

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 2.7.13, 3.0.2, 3.1
    • Component/s: JAX-RS
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      In ExceptionUtils.convertFaultToResponse(), it only catches Exception. So CXF fails to process the request if we throw Error in our own XXXExceptionMapper. The definition of ExceptionMapper is:
      Interface ExceptionMapper<E extends Throwable> So I think we should catch Throwable instead.

      if (response == null) {
      ExceptionMapper<T> mapper =
      ServerProviderFactory.getInstance(inMessage).createExceptionMapper(ex.getClass(), inMessage);
      if (mapper != null) {
      try

      { response = mapper.toResponse(ex); }

      catch (Exception mapperEx)

      { inMessage.getExchange().put(JAXRSUtils.EXCEPTION_FROM_MAPPER, "true"); mapperEx.printStackTrace(); return Response.serverError().build(); }


      }
      }
      }

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              irisding iris ding
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: