Custom Error Handler Implementation


I have followed the custom error handling guidelines as here: to create an ErrorController as in Zend.

The /controllers/ErrorController.php code:

class ErrorController extends CController



 * This is the default 'index' action that is invoked

 * It handles uncaught exceptions


public function actionIndex()





			echo $error['message'];


			$this->render('index', $error);




The /views/error/index.php view:

/* @var $this ErrorController */

/* @var $error array */

$this->pageTitle=Yii::app()->name . ’ - Error’;





<h2>Error <?php echo $code; ?></h2>

<div class="error">

<?php echo CHtml::encode($message); ?>


The configuration file settings:


		// use 'error/index' action to display errors



In a controller I’ve inserted

trigger_error("Test for custom error processing", E_USER_ERROR);

but the result is that this error is still shown in the standard CErrorHandler view. Moreover, the stack trace lists CErrorHandler rather than to my ErrorController, though is defined in the config file.