Skip to content

Commit 2fc595d

Browse files
authored
Merge pull request #895 from cakephp/error-config
4.4 - Allow exception rendering to auto-detect based on environment.
2 parents e57567b + 45ef002 commit 2fc595d

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

config/app.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,24 +164,28 @@
164164
* - `trace` - boolean - Whether or not backtraces should be included in
165165
* logged errors/exceptions.
166166
* - `log` - boolean - Whether or not you want exceptions logged.
167-
* - `exceptionRenderer` - string - The class responsible for rendering
168-
* uncaught exceptions. If you choose a custom class you should place
169-
* the file for that class in src/Error. This class needs to implement a
170-
* render method.
167+
* - `exceptionRenderer` - string - The class responsible for rendering uncaught exceptions.
168+
* The chosen class will be used for for both CLI and web environments. If you want different
169+
* classes used in CLI and web environments you'll need to write that conditional logic as well.
170+
* The conventional location for custom renderers is in `src/Error`. Your exception renderer needs to
171+
* implement the `render()` method and return either a string or Http\Response.
172+
* `errorRenderer` - string - The class responsible for rendering PHP errors. The selected
173+
* class will be used for both web and CLI contexts. If you want different classes for each environment
174+
* you'll need to write that conditional logic as well. Error renderers need to
175+
* to implement the `Cake\Error\ErrorRendererInterface`.
171176
* - `skipLog` - array - List of exceptions to skip for logging. Exceptions that
172177
* extend one of the listed exceptions will also be skipped for logging.
173178
* E.g.:
174179
* `'skipLog' => ['Cake\Http\Exception\NotFoundException', 'Cake\Http\Exception\UnauthorizedException']`
175-
* - `extraFatalErrorMemory` - int - The number of megabytes to increase
176-
* the memory limit by when a fatal error is encountered. This allows
180+
* - `extraFatalErrorMemory` - int - The number of megabytes to increase the memory limit by
181+
* when a fatal error is encountered. This allows
177182
* breathing room to complete logging or error handling.
178183
* - `ignoredDeprecationPaths` - array - A list of glob compatible file paths that deprecations
179184
* should be ignored in. Use this to ignore deprecations for plugins or parts of
180185
* your application that still emit deprecations.
181186
*/
182187
'Error' => [
183188
'errorLevel' => E_ALL,
184-
'exceptionRenderer' => ExceptionRenderer::class,
185189
'skipLog' => [],
186190
'log' => true,
187191
'trace' => true,

0 commit comments

Comments
 (0)