original_string: private function _responseFailHandle($error, $index)
      {
          $cbk = $this->requestList[$index]->getFailCallbackList();
          if (! empty($cbk)) {
              $error = array_reduce($cbk, function ($prev, $cb) {
                  return $cb($prev);
              }, $error);
          }
          $response = new SimpleResponse();
          $response->setFail($error);
          $this->requestList[$index]->setResponse($response);
      }
code: private function _responseFailHandle($error, $index)
      {
          $cbk = $this->requestList[$index]->getFailCallbackList();
          if (! empty($cbk)) {
              $error = array_reduce($cbk, function ($prev, $cb) {
                  return $cb($prev);
              }, $error);
          }
          $response = new SimpleResponse();
          $response->setFail($error);
          $this->requestList[$index]->setResponse($response);
      }
code_tokens: private function _responseFailHandle ( $ error , $ index ) { $ cbk = $ this -> requestList [ $ index ] -> getFailCallbackList ( ) ; if ( ! empty ( $ cbk ) ) { $ error = array_reduce ( $ cbk , function ( $ prev , $ cb ) { return $ cb ( $ prev ) ; } , $ error ) ; } $ response = new SimpleResponse ( ) ; $ response -> setFail ( $ error ) ; $ this -> requestList [ $ index ] -> setResponse ( $ response ) ; }
docstring: when request failed this method will be called
  @param mixed $error
  @param int $index
docstring_tokens: when request failed this method will be called