mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
More documentation.
This commit is contained in:
parent
f3feb1575c
commit
9b4f7a1a15
2 changed files with 26 additions and 9 deletions
|
@ -21,8 +21,12 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Error Handler provides basic error and exception handling for your application. It Captures and
|
||||
* handles all unhandled exceptions. Displays helpful framework errors when debug > 1.
|
||||
*
|
||||
* Error Handler provides basic error and exception handling for your application. It captures and
|
||||
* handles all unhandled exceptions and errors. Displays helpful framework errors when debug > 1.
|
||||
*
|
||||
* ### Uncaught exceptions
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
@ -68,6 +72,20 @@
|
|||
* errors will be logged to CakeLog. You can control which errors are logged by setting
|
||||
* `Error.level` in your core.php.
|
||||
*
|
||||
* #### Logging errors
|
||||
*
|
||||
* When ErrorHandler is used for handling errors, you can enable error logging by setting `Error.log` to true.
|
||||
* This will log all errors to the configured log handlers.
|
||||
*
|
||||
* #### Controlling what errors are logged/displayed
|
||||
*
|
||||
* You can control which errors are logged / displayed by ErrorHandler by setting `Error.level`. Setting this
|
||||
* to one or a combination of a few of the E_* constants will only enable the specified errors.
|
||||
*
|
||||
* e.g. `Configure::write('Error.level', E_ALL & ~E_NOTICE);`
|
||||
*
|
||||
* Would enable handling for all non Notice errors.
|
||||
*
|
||||
* @package cake
|
||||
* @subpackage cake.cake.libs
|
||||
* @see ExceptionRenderer for more information on how to customize exception rendering.
|
||||
|
|
|
@ -27,24 +27,23 @@
|
|||
* When debug < 1 a CakeException will render 404 or 500 errors. If an uncaught exception is thrown
|
||||
* and it is a type that ExceptionHandler does not know about it will be treated as a 500 error.
|
||||
*
|
||||
* ### Implementing application specific exception handling
|
||||
* ### Implementing application specific exception rendering
|
||||
*
|
||||
* You can implement application specific exception handling in one of a few ways:
|
||||
*
|
||||
* - Create a AppController::appError();
|
||||
* - Create an AppError class.
|
||||
* - Create a subclass of ExceptionRenderer and configure it to be the `Exception.renderer`
|
||||
*
|
||||
* #### Using AppController::appError();
|
||||
*
|
||||
* This controller method is called instead of the default exception handling. It receives the
|
||||
* thrown exception as its only argument. You should implement your error handling in that method.
|
||||
*
|
||||
* #### Using an AppError class
|
||||
* #### Using a subclass of ExceptionRenderer
|
||||
*
|
||||
* This approach gives more flexibility and power in how you handle exceptions. You can create
|
||||
* `app/libs/app_error.php` and create a class called `AppError`. The core ErrorHandler class
|
||||
* will attempt to construct this class and let it handle the exception. This provides a more
|
||||
* flexible way to handle exceptions in your application.
|
||||
* Using a subclass of ExceptionRenderer gives you full control over how Exceptions are rendered, you
|
||||
* can configure your class in your core.php, with `Configure::write('Exception.renderer', 'MyClass');`
|
||||
* You should place any custom exception renderers in `app/libs`.
|
||||
*
|
||||
* @package cake
|
||||
* @subpackage cake.cake.libs
|
||||
|
|
Loading…
Add table
Reference in a new issue