title: How handling error of JSON decode by try and catch
body: <p>I am unable to handle JSON decode errors. Here is my code:</p>
  <pre class="lang-php prettyprint-override"><code>try {
      $jsonData = file_get_contents($filePath) . ']';
      $jsonObj  = json_decode($jsonData, true);
  }
  catch (Exception $e) {
      echo '{&quot;result&quot;:&quot;FALSE&quot;,&quot;message&quot;:&quot;Caught exception: ' . $e-&gt;getMessage() . ' ~' . $filePath . '&quot;}';
  }
  </code></pre>
  <p>I am a new PHP programmer. Sorry, if something is wrong.</p>