title: How to manage FewArguments Exception?
body: <p>I have a javascript file which redirect the user to the <code>Dashboard</code> controller and invoke the <code>survey</code> method like:</p>
  
  <pre><code>window.location.href = GlobalVariables.baseUrl + '/dashboard/survey/'+survey_id;
  </code></pre>
  
  <p>the variable <code>survey_id</code> is an argument passed in the redirection method. Now suppose that the user just type in the browser the address: <code>../dashboard/survey</code> an error will happen eg:</p>
  
  <blockquote>
    <p>ArgumentCountError</p>
  </blockquote>
  
  <p>because the method:</p>
  
  <pre><code>public function survey($survey_id)
  {
      $this-&gt;load-&gt;view('products/survey', $survey_id);
  }
  </code></pre>
  
  <p>how can I manage this error? Or maybe there is a better way to do this?</p>
  
  <p>Thanks in advance.</p>