Skip to content

Commit

Permalink
Fixing comments and removing cakeError(). Instead you should be throw…
Browse files Browse the repository at this point in the history
…ing exceptions.
  • Loading branch information
markstory committed Sep 4, 2010
1 parent af87e5d commit fa7549d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 31 deletions.
4 changes: 2 additions & 2 deletions cake/libs/error_handler.php
Expand Up @@ -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
*
Expand Down
30 changes: 1 addition & 29 deletions cake/libs/object.php
Expand Up @@ -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.
Expand Down Expand Up @@ -155,34 +155,6 @@ protected function _set($properties = array()) {
}
}

/**
* 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
Expand Down

0 comments on commit fa7549d

Please sign in to comment.