public static final PolicyFailure getPolicyFailure() {
        PolicyFailure failure = policyFailure.get();
        if (failure == null) {
            failure = new PolicyFailure();
            policyFailure.set(failure);
        }
        failure.setResponseCode(0);
        failure.setFailureCode(0);
        failure.setMessage(null);
        failure.setType(null);
        failure.getHeaders().clear();
        return failure;
    }
@return the thread-local policy failure
gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayThreadContext.java