title: Exception not able to get caught in catch block - Yii2
body: <p>Exception</p>
  <blockquote>
  <p>Exception 'Error' with message 'Class 'app\commands\CallLogs' not
  found'</p>
  </blockquote>
  <p>is not able to get caught in catch block.</p>
  <p>Code:</p>
  <p>I tried with calling undefined class just to see how and what exception catch block catches.</p>
  <pre><code>public function actionTest(){
      try {
          $logs = new CallLogs();
      } catch (\yii\base\Exception $ex) {
          print $ex-&gt;getMessage();
      } catch(\ErrorException $ex){
          print $ex-&gt;getMessage();
      }
  }
  </code></pre>
  <p>But, When I intentionally throw any exception, it works.</p>
  <pre><code>public function actionTest(){
      try {
          throw new \yii\base\Exception('hello');
      } catch (\yii\base\Exception $ex) {
          print $ex-&gt;getMessage();
      } catch(\ErrorException $ex){
          print $ex-&gt;getMessage();
      }
  }
  </code></pre>
  <p>I have tried with base\Exception class and \ErrorException class. But, no help.</p>
  <p>Any help/hint is appreciable</p>