PHP Class Prado\Exceptions\TException

TException is the base class for all PRADO exceptions. TException provides the functionality of translating an error code into a descriptive error message in a language that is preferred by user browser. Additional parameters may be passed together with the error code so that the translated message contains more detailed information. By default, TException looks for a message file by calling {@link getErrorMessageFile()} method, which uses the "message-xx.txt" file located under "System.Exceptions" folder, where "xx" is the code of the user preferred language. If such a file is not found, "message.txt" will be used instead.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends Exception
Mostra file Open project: pradosoft/prado Class Usage Examples

Public Properties

Property Type Description
$_messageCache

Public Methods

Method Description
__construct ( $errorMessage ) Constructor.
getErrorCode ( ) : string
getErrorMessage ( ) : string
setErrorCode ( $code )

Protected Methods

Method Description
getErrorMessageFile ( ) : string
setErrorMessage ( $message )
translateErrorMessage ( $key ) : string Translates an error code into an error message.

Method Details

__construct() public method

Constructor.
public __construct ( $errorMessage )

getErrorCode() public method

public getErrorCode ( ) : string
return string error code

getErrorMessage() public method

public getErrorMessage ( ) : string
return string error message

getErrorMessageFile() protected method

protected getErrorMessageFile ( ) : string
return string path to the error message file

setErrorCode() public method

public setErrorCode ( $code )

setErrorMessage() protected method

protected setErrorMessage ( $message )

translateErrorMessage() protected method

Translates an error code into an error message.
protected translateErrorMessage ( $key ) : string
return string the translated error message

Property Details

$_messageCache static_oe public_oe property

static public $_messageCache