We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 76074c2 commit be227f2Copy full SHA for be227f2
lib/Elastica/Type.php
@@ -224,8 +224,12 @@ public function getDocument($id, $options = array())
224
{
225
$path = urlencode($id);
226
227
- $response = $this->request($path, Request::GET, array(), $options);
228
- $result = $response->getData();
+ try {
+ $response = $this->request($path, Request::GET, array(), $options);
229
+ $result = $response->getData();
230
+ } catch (ResponseException $e) {
231
+ throw new NotFoundException('unable to retrieve doc id ' . $id. ': '.$e->getMessage(), $e->getCode(), $e);
232
+ }
233
234
$info = $response->getTransferInfo();
235
if ($info['http_code'] !== 200) {
0 commit comments