Page MenuHomePhabricator

D12284.diff
No OneTemporary

D12284.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
Wed, May 15, 11:58 PM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6297124
Default Alt Text
D12284.diff (723 B)

Event Timeline