class PolicyExceptionMapper implements ExceptionMapper<TException> {

    @Override
    public final Response toResponse(TException exception) {
        if (exception instanceof NotFoundException) {
            return Response.status(Response.Status.NOT_FOUND).build();
        } else if (noSessionIdInQueryStringOrPathParam() && inARequestWhereWeExpectContext()) {
            LOG.error(MessageFormat.format("No Session Id found for request to: {0}", httpServletRequest.getRequestURI()), exception);
            return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
        }
        return handleException(exception);
    }

    public  PolicyExceptionMapper();

}