code: private IAsyncHandler<PolicyFailure> createPolicyFailureHandler() {
          return policyFailure -> {
              // One of the policies has triggered a failure. At this point we should stop processing and
              // send the failure to the client for appropriate handling.
              EngineResultImpl engineResult = new EngineResultImpl(policyFailure);
              resultHandler.handle(AsyncResultImpl.<IEngineResult> create(engineResult));
          };
      }
docs: Creates the handler to use when a policy failure occurs during processing
  of a chain.