所有错误的Cakephp自定义错误页

所有错误的Cakephp自定义错误页,cakephp,error-handling,cakephp-2.1,custom-error-pages,Cakephp,Error Handling,Cakephp 2.1,Custom Error Pages,我创建了以下内容: <?php class AppExceptionHandler { public static function handle($error) { $this->controller->redirect('www.google.com'); //echo 'Oh noes! ' . $error->getMessage(); // ... } // ...

我创建了以下内容:

<?php

class AppExceptionHandler
{
    public static function handle($error)
    {       
        $this->controller->redirect('www.google.com');
        //echo 'Oh noes! ' . $error->getMessage();
        // ...
    }
    // ...
}

?>

尝试在AppController.php中添加以下方法

public function appError($error) {
    //Do whatever you want
    debug($error);
}

可能重复:我认为appError已被弃用
public function appError($error) {
    //Do whatever you want
    debug($error);
}