code: public static Response toResponse(Response.Status status, String wwwAuthHeader) {
          Response.ResponseBuilder rb = Response.status(status);
          if (wwwAuthHeader != null) {
              rb.header("WWW-Authenticate", wwwAuthHeader);
          }
          return rb.build();
      }
docs: Maps this exception to a response object.
  
  @return Response this exception maps to.