From fa7549dc4cd8e99cfcc4f7ad4c0abb4b7fc7fe34 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 4 Sep 2010 01:34:45 -0400 Subject: [PATCH] Fixing comments and removing cakeError(). Instead you should be throwing exceptions. --- cake/libs/error_handler.php | 4 ++-- cake/libs/object.php | 30 +----------------------------- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/cake/libs/error_handler.php b/cake/libs/error_handler.php index 3b59f55da..8ae834d46 100644 --- a/cake/libs/error_handler.php +++ b/cake/libs/error_handler.php @@ -24,8 +24,8 @@ * Error Handler. * * Captures and handles all unhandled exceptions. Displays helpful framework errors when debug > 1. - * When debug < 1 cakeError() will render 404 or 500 errors. If an uncaught exception is thrown - * and it is a type that ErrorHandler does not know about it will be treated as a 500 error. + * When debug < 1 a CakeException will render 404 or 500 errors. If an uncaught exception is thrown + * and it is a type that ErrorHandler does not know about it will be treated as a 500 error. * * ### Implementing application specific exception handling * diff --git a/cake/libs/object.php b/cake/libs/object.php index b4da0bd68..987ba0154 100644 --- a/cake/libs/object.php +++ b/cake/libs/object.php @@ -22,7 +22,7 @@ */ /** - * Object class, allowing __construct and __destruct in PHP4. + * Object class provides a few generic methods used in several subclasses. * * Also includes methods for logging and the special method RequestAction, * to call other Controllers' Actions from anywhere. @@ -155,34 +155,6 @@ class Object { } } -/** - * Used to report user friendly errors. - * If there is a file app/error.php or app/app_error.php this file will be loaded - * error.php is the AppError class it should extend ErrorHandler class. - * - * @param string $method Method to be called in the error class (AppError or ErrorHandler classes) - * @param array $messages Message that is to be displayed by the error class - * @return error message - */ - public function cakeError($method, $messages = array()) { - if (!class_exists('ErrorHandler')) { - App::import('Core', 'Error'); - - if (file_exists(APP . 'error.php')) { - include_once (APP . 'error.php'); - } elseif (file_exists(APP . 'app_error.php')) { - include_once (APP . 'app_error.php'); - } - } - - if (class_exists('AppError')) { - $error = new AppError($method, $messages); - } else { - $error = new ErrorHandler($method, $messages); - } - return $error; - } - /** * Checks for a persistent class file, if found file is opened and true returned * If file is not found a file is created and false returned