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

Improve the code fragment in section 8.2.1

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None

      Description

      The code fragment in section 8.2.1 says:

      ar.resume("Operation timed out – please try again");

      It should instead be using

      ar.resume(Throwable) version instead.

        Activity

        Hide
        Santiago Pericas-Geertsen added a comment -

        Although it would possible to change the example as suggested, it does not necessarily make the example better. As stated in that section "JAX-RS implementations are REQUIRED to generate a ServiceUnavailableException, a subclass of WebApplicationException with its status set to 503, if the timeout value is reached and no timeout handler is registered."

        So if an exception (or Throwable) is preferred then why register a handler in first place?

        Show
        Santiago Pericas-Geertsen added a comment - Although it would possible to change the example as suggested, it does not necessarily make the example better. As stated in that section "JAX-RS implementations are REQUIRED to generate a ServiceUnavailableException, a subclass of WebApplicationException with its status set to 503, if the timeout value is reached and no timeout handler is registered." So if an exception (or Throwable) is preferred then why register a handler in first place?
        Hide
        Santiago Pericas-Geertsen added a comment -

        Improved example by returning a Response with status code 503.

        Show
        Santiago Pericas-Geertsen added a comment - Improved example by returning a Response with status code 503.

          People

          • Assignee:
            Santiago Pericas-Geertsen
            Reporter:
            arungupta
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: