Call A Function In Catch Block In Yii Model

All,

I have problem on calling the function in catch block. See the below piece of code sample

Batch.php (model)




/*

* BatchInsert

*/


public function batchInsert($data, $mode)

{

       ....

       ....


      try

      {

           $FundedAmt = $this->calculateRealRebate($amt, $loan_id, $princpal_paid);     

      }

      catch (Exception $e)

      {

	$msg = $e->getMessage();

        $Mail->sendmail($msg, 'ERR');

	$report = new InterestCal();

	$report->getDetailedFunds();	

      }

       ....

       ....


}



I am calling the calculateRealRebate() funtion from Batch model. and i supposed to get an error of this function i need to call from the beginning function which is in InterestCal of getDetailedFunds function.

But the mentioned scenario is getting failed by calling the catch block.

Kindly advise regarding this ASAP.

Thanks in Advance.

Maybe you can try the ifelse statement.


$FundedAmt = $this->calculateRealRebate($amt, $loan_id, $princpal_paid);

if($FundedAmt){

 //your code..

}else {

 // your error code.

}

Can i call my function in else block??