Page MenuHomePhabricator

D12284.id29506.diff
No OneTemporary

D12284.id29506.diff

diff --git a/src/parser/xhpast/api/XHPASTTree.php b/src/parser/xhpast/api/XHPASTTree.php
--- a/src/parser/xhpast/api/XHPASTTree.php
+++ b/src/parser/xhpast/api/XHPASTTree.php
@@ -62,9 +62,13 @@
throw new Exception("XHPAST failed to parse file data {$err}: {$stderr}");
}
- $data = json_decode($stdout, true);
- if (!is_array($data)) {
- throw new Exception('XHPAST: failed to decode tree.');
+ $data = null;
+ try {
+ $data = phutil_json_decode($stdout);
+ } catch (PhutilJSONParserException $ex) {
+ throw new PhutilProxyException(
+ pht('XHPAST: failed to decode tree.'),
+ $ex);
}
return new XHPASTTree($data['tree'], $data['stream'], $php_source);

File Metadata

Mime Type
text/plain
Expires
Sun, May 19, 8:30 AM (2 w, 17 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6297124
Default Alt Text
D12284.id29506.diff (723 B)

Event Timeline