| @@ 79-86 (lines=8) @@ | ||
| 76 | * |
|
| 77 | * @throws \UnexpectedValueException If request was not part of the batch or failed |
|
| 78 | */ |
|
| 79 | public function getResponseFor(RequestInterface $request) |
|
| 80 | { |
|
| 81 | try { |
|
| 82 | return $this->responses[$request]; |
|
| 83 | } catch (\UnexpectedValueException $e) { |
|
| 84 | throw new \UnexpectedValueException('Request not found', $e->getCode(), $e); |
|
| 85 | } |
|
| 86 | } |
|
| 87 | ||
| 88 | /** |
|
| 89 | * Adds a response in an immutable way. |
|
| @@ 151-158 (lines=8) @@ | ||
| 148 | * |
|
| 149 | * @throws \UnexpectedValueException If request was not part of the batch or was successful |
|
| 150 | */ |
|
| 151 | public function getExceptionFor(RequestInterface $request) |
|
| 152 | { |
|
| 153 | try { |
|
| 154 | return $this->exceptions[$request]; |
|
| 155 | } catch (\UnexpectedValueException $e) { |
|
| 156 | throw new \UnexpectedValueException('Request not found', $e->getCode(), $e); |
|
| 157 | } |
|
| 158 | } |
|
| 159 | ||
| 160 | /** |
|
| 161 | * Adds an exception in an immutable way. |
|