コード例 #1
0
 public function testInterceptsWithEvent()
 {
     $t = new Transaction(new Client(), new Request('GET', '/'));
     $except = new RequestException('foo', $t->request);
     $t->exception = $except;
     $e = new ErrorEvent($t);
     $this->assertSame($e->getException(), $t->exception);
 }
コード例 #2
0
ファイル: History.php プロジェクト: hellsigner/guzzle5-legacy
 public function onError(ErrorEvent $event)
 {
     // Only track when no response is present, meaning this didn't ever
     // emit a complete event
     if (!$event->getResponse()) {
         $this->add($event->getRequest());
     }
 }