0

When a PHP error is thrown in Yii you get a PHP Warning Page with a Stack Trace.

Is it possible to show my own version of this page. I thought this was included in the errorHandler, but nothing i change effects the error page.

Since we've got an important update to our system new out of Beta, with extra updates coming soon, I would like to give our users a dump of relevant POST data so that they dont completely lose their work. (The data they're adding is gained over the phone, so the only option they have at the moment is to listen back to their phone conversation, which isn't every efficient.

Any ideas would be welcome

EDIT: I have tried using the Yii errorHandler, but nothing i do seems to change outcome. I'll add my code:

main config

'errorHandler'=>array(
    // use 'site/error' action to display errors
    'errorAction'=>'site/error',
),

SiteController

if($error=Yii::app()->errorHandler->error)
{
    $this->render('error', $error);
}

The error view only conatains html at the moment, but I still always get the error page with the Stack Trace

4

1 回答 1

0

我发现我的问题与此有关。

您需要从 index.php 中删除以下行:

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
于 2013-11-14T09:18:43.880 回答