Controller/Plugin/ErrorHandler.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Controller
- Subpackage
- Plugins
\Zend_Controller_Plugin_ErrorHandler
Package: Zend_Controller\Plugins

















Handle exceptions that bubble up based on missing controllers, actions, or
application errors, and forward to an error handler.
- Parent(s)
- \Zend_Controller_Plugin_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Uses
- Version
- $Id$
Constants

EXCEPTION_NO_CONTROLLER
= 'EXCEPTION_NO_CONTROLLER'
Const - No controller exception; controller does not exist

EXCEPTION_NO_ACTION
= 'EXCEPTION_NO_ACTION'
Const - No action exception; controller exists, but action does not
Properties


string $_errorAction = 'error'
Action to use for errors; defaults to 'error'
Default value
'error'
Details- Type
- string


string $_errorController = 'error'
Controller to use for errors; defaults to 'error'
Default value
'error'
Details- Type
- string


string $_errorModule
Module to use for errors; defaults to default module in dispatcher
Details
- Type
- string


int $_exceptionCountAtFirstEncounter = 0
Exception count logged at first invocation of plugin
Default value
0
Details- Type
- int
Methods


__construct(Array $options = array()) : void
Constructor
Options may include:
- module
- controller
- action
ParametersName | Type | Description |
---|---|---|
$options | Array |


_handleError(\Zend_Controller_Request_Abstract $request) : void
Handle errors and exceptions
If the 'noErrorHandler' front controller flag has been set,
returns early.
ParametersName | Type | Description |
---|---|---|
$request | \Zend_Controller_Request_Abstract |


getErrorHandlerAction() : string
Retrieve the current error handler action
Returns
Type | Description |
---|---|
string |


getErrorHandlerController() : string
Retrieve the current error handler controller
Returns
Type | Description |
---|---|
string |


getErrorHandlerModule() : string
Retrieve the current error handler module
Returns
Type | Description |
---|---|
string |


postDispatch(\Zend_Controller_Request_Abstract $request) : void
Post dispatch hook -- check for exceptions and dispatch error handler if necessary
Parameters
Name | Type | Description |
---|---|---|
$request | \Zend_Controller_Request_Abstract |


preDispatch(\Zend_Controller_Request_Abstract $request) : void
Pre dispatch hook -- check for exceptions and dispatch error handler if necessary
Parameters
Name | Type | Description |
---|---|---|
$request | \Zend_Controller_Request_Abstract |


routeShutdown(\Zend_Controller_Request_Abstract $request) : void
Route shutdown hook -- Ccheck for router exceptions
Parameters
Name | Type | Description |
---|---|---|
$request | \Zend_Controller_Request_Abstract |


setErrorHandler(array $options = array()) : \Zend_Controller_Plugin_ErrorHandler
setErrorHandler() - setup the error handling options
Parameters
Returns
Name | Type | Description |
---|---|---|
$options | array |
Type | Description |
---|---|
\Zend_Controller_Plugin_ErrorHandler |


setErrorHandlerAction(string $action) : \Zend_Controller_Plugin_ErrorHandler
Set the action name for the error handler
Parameters
Returns
Name | Type | Description |
---|---|---|
$action | string |
Type | Description |
---|---|
\Zend_Controller_Plugin_ErrorHandler |


setErrorHandlerController(string $controller) : \Zend_Controller_Plugin_ErrorHandler
Set the controller name for the error handler
Parameters
Returns
Name | Type | Description |
---|---|---|
$controller | string |
Type | Description |
---|---|
\Zend_Controller_Plugin_ErrorHandler |


setErrorHandlerModule(string $module) : \Zend_Controller_Plugin_ErrorHandler
Set the module name for the error handler
Parameters
Returns
Name | Type | Description |
---|---|---|
$module | string |
Type | Description |
---|---|
\Zend_Controller_Plugin_ErrorHandler |