jax-rs-spec
  1. jax-rs-spec
  2. JAX_RS_SPEC-270

Review the possibility of ExceptionMapper supporting @Produces

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: providers
    • Labels:
      None

      Description

      When a custom exception mapper sets a Response entity it has to:

      • Inject HttpHeaders, introspect the acceptable types and set the type and the entity accordingly

      The process can be simplified if ExceptionMapper supported @Produces. The only possible issue in this case is that Accept and @Produces values will not intersect - in this case the proposal is to ignore the entity, issue a warning (log it), and return only status and custom headers (if any)

        Activity

        Hide
        bimargulies added a comment -

        Another option is to select mappers based on @Produces, and if none match, none are selected.

        Show
        bimargulies added a comment - Another option is to select mappers based on @Produces, and if none match, none are selected.
        Hide
        Santiago Pericas-Geertsen added a comment -

        Looks like a duplicate of JAX_RS_SPEC-323.

        Show
        Santiago Pericas-Geertsen added a comment - Looks like a duplicate of JAX_RS_SPEC-323 .

          People

          • Assignee:
            Marek Potociar
            Reporter:
            beryozkin_sergey
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: