Public Member Functions | Protected Member Functions | Protected Attributes

AppError Class Reference

BEdita/cake error handler (backends+frontends). More...

List of all members.

Public Member Functions

 __construct ($method, $messages, Exception $exception=null)
 restoreDebugLevel ()
 handleException (array $messages)
 handleSmartyException (array $messages)
 handleBeditaAjaxException (array $messages)
 handle ajax exception
 handleExceptionRuntime (array $messages)
 handleExceptionFrontend (array $messages)
 handleExceptionFrontAccess (array $messages)
 _outputMessage ($template)
 __outputMessage ($template)
 getUrl ()
 Return the request url.
 getMessage ()
 Return the error message If an exception has created the error use its message else try to read some View vars set by CakePHP.

Protected Member Functions

 setLayout ($layout= 'error')
 Set the layout to use If Request is ajax set ajax layout.
 setError (array $error=array())
 Set self::error to View vars and add also it to '_serialize' for ResponseHandlerComponent.
 getViewFile ()
 Return the error template to use The template depends from http status code triggered from Exception.

Protected Attributes

 $error404 = array('missingController', 'missingAction')
 $errorTrace = ''
 $debugLevel
 $exception = null
 $error
 $layout = 'error'

Detailed Description

BEdita/cake error handler (backends+frontends).

Definition at line 27 of file app_error.php.


Member Function Documentation

AppError::getMessage (  ) 

Return the error message If an exception has created the error use its message else try to read some View vars set by CakePHP.

Returns:
string

Definition at line 518 of file app_error.php.

AppError::getUrl (  ) 

Return the request url.

Returns:
string|null

Definition at line 496 of file app_error.php.

AppError::getViewFile (  )  [protected]

Return the error template to use The template depends from http status code triggered from Exception.

First it checks if exists 'views/errors/error' . self::exception::httpCode() . '.tpl' (or .ctp) If it not exists then it return the more general 'views/errors/error.tpl' (or .ctp)

Returns:
string

Definition at line 242 of file app_error.php.

AppError::handleBeditaAjaxException ( array $  messages  ) 

handle ajax exception

Parameters:
array $messages 'msg' => the exception message 'details' => the error detail 'output' => the output type. It can be: 'html' (default) BEdita html standard error message from elements/message.tpl 'json' json object is built in view as: { errorMsg: exception message, htmlMsg: BEdita html standard error message from see elements/message.tpl } 'beditaMsg' output the BEdita html standard error message and trigger it 'reload' javascript: location.reload(); used for example when the session expired in a ajax call 'headers' => server headers (usually header error): if it's not set or === null no headers error will be sent if it's set and empty use "HTTP/1.1 500 Internal Server Error"

Definition at line 308 of file app_error.php.

AppError::handleExceptionFrontAccess ( array $  messages  ) 
Deprecated:
Parameters:
array $messages
Returns:
void

Definition at line 396 of file app_error.php.

AppError::handleExceptionFrontend ( array $  messages  ) 
Deprecated:
Parameters:
array $messages
Returns:
void

Definition at line 377 of file app_error.php.

AppError::handleExceptionRuntime ( array $  messages  ) 
Deprecated:
Parameters:
array $messages
Returns:
void

Definition at line 358 of file app_error.php.

AppError::setError ( array $  error = array()  )  [protected]

Set self::error to View vars and add also it to '_serialize' for ResponseHandlerComponent.

Parameters:
array $error

Definition at line 218 of file app_error.php.

AppError::setLayout ( layout = 'error'  )  [protected]

Set the layout to use If Request is ajax set ajax layout.

Parameters:
string $layout
Returns:
void

Definition at line 206 of file app_error.php.


Member Data Documentation

AppError::$error [protected]
Initial value:
 array(
        'status' => null,
        'code' => null,
        'message' => null,
        'details' => null,
        'more_info' => null,
        'url' => null
    )

Definition at line 75 of file app_error.php.


The documentation for this class was generated from the following file:
Generated on Fri Dec 11 2015 15:29:46 by Doxygen 1.7.1  BEditaBEdita 3.7 Corylus