From a5f568f9d74b33b555de3055c9b7af24617bfabd Mon Sep 17 00:00:00 2001 From: Chip Turner Date: Thu, 16 May 2013 17:23:09 -0700 Subject: [PATCH] Add a nice error message when json failes to parse and fix Makefile rule I had a json that wouldn't parse (trailing comma) but it was an odd php error about iterating over a null. So this should give a slightly better error. Also, .inc files are no longer used. Remove the Makefile references. --- hphp/idl/base.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hphp/idl/base.php b/hphp/idl/base.php index 6232b283c..598997598 100644 --- a/hphp/idl/base.php +++ b/hphp/idl/base.php @@ -370,6 +370,9 @@ function DefineFunction($func) { function ReadIDLFile($path) { $entries = json_decode(file_get_contents($path), /* use arrays */ true); + if (!$entries) { + throw new Exception("Unable to parse json from $path"); + } if (!empty($entries['funcs'])) { foreach ($entries['funcs'] as $func) {