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); }
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()); } }