Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/engine/PhabricatorElasticSearchEngine.php
| Show First 20 Lines • Show All 391 Lines • ▼ Show 20 Lines | if ($this->getTimeout()) { | ||||
| $future->setTimeout($this->getTimeout()); | $future->setTimeout($this->getTimeout()); | ||||
| } | } | ||||
| list($body) = $future->resolvex(); | list($body) = $future->resolvex(); | ||||
| if ($method != 'GET') { | if ($method != 'GET') { | ||||
| return null; | return null; | ||||
| } | } | ||||
| $body = json_decode($body, true); | try { | ||||
| if (!is_array($body)) { | return phutil_json_decode($body); | ||||
| throw new Exception('elasticsearch server returned invalid JSON!'); | } catch (PhutilJSONParserException $ex) { | ||||
| throw new PhutilProxyException( | |||||
| pht('ElasticSearch server returned invalid JSON!'), | |||||
| $ex); | |||||
| } | } | ||||
| return $body; | |||||
| } | } | ||||
| } | } | ||||