title: PHP Notice: Undefined index although using try\catch
body: <p>This is my try/catch block in PHP:</p>
  
  <pre><code>try
  {
      $api = new api($_GET["id"]);
      echo $api -&gt; processRequest();
  } catch (Exception $e) {
      $error = array("error" =&gt; $e-&gt;getMessage());
      echo json_encode($error);
  }
  </code></pre>
  
  <p>When there is nothing in the <code>$_GET["id"]</code>, I still get the notice error.
  How can I avoid getting this error?</p>