class RsrcCtxWrapper implements ResourceContext {

    void throwZmsException(com.yahoo.athenz.common.server.rest.ResourceException restExc) {

        // first check to see if this is an auth failure and if
        // that's the case include the WWW-Authenticate challenge

        ctx.sendAuthenticateChallenges(restExc);

        // now throw a ZMS exception based on the rest exception

        String msg  = null;
        Object data = restExc.getData();
        if (data instanceof String) {
            msg = (String) data;
        }
        if (msg == null) {
            msg = restExc.getMessage();
        }
        throw new com.yahoo.athenz.zms.ResourceException(restExc.getCode(),
                new ResourceError().code(restExc.getCode()).message(msg));
    }

      RsrcCtxWrapper(HttpServletRequest request, HttpServletResponse response,
                   Http.AuthorityList authList, boolean optionalAuth,
                   Authorizer authorizer, Object timerMetric, String apiName);

}