Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function onRequestErrored(RequestErroredEvent $event)
 {
     if (($request = $this->retry->retry($event->getException()->getRequest())) === false) {
         return;
     }
     $event->getException()->setRequest($request);
     try {
         $event->setResponse($event->getHttpAdapter()->sendRequest($request));
     } catch (HttpAdapterException $e) {
         $event->setException($e);
     }
 }
Exemplo n.º 2
0
 /**
  * On request errored event.
  *
  * @param \Ivory\HttpAdapter\Event\RequestErroredEvent $event The request errored event.
  */
 public function onRequestErrored(RequestErroredEvent $event)
 {
     $event->getException()->setRequest($this->error($event->getHttpAdapter(), $event->getException()));
 }
Exemplo n.º 3
0
 /**
  * On request errored event.
  *
  * @param \Ivory\HttpAdapter\Event\RequestErroredEvent $event The event.
  */
 public function onRequestErrored(RequestErroredEvent $event)
 {
     $this->stopwatch->stop($this->getStopwatchName($event->getHttpAdapter(), $event->getException()->getRequest()));
 }