## Class TException

Description

TException class

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 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
- version: $Revision: $ $Date: $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Exceptions/TException.php (line 35)

    Exception
       |
       --TException

Direct descendents

Class | Description
--- | ---
TSystemException | TSystemException class
TApplicationException | TApplicationException class
TMessageSourceIOException | TMessageSourceIOException thrown when unable to modify message source data.

Method Summary
TException __construct (string $errorMessage)
string getErrorCode ()
string getErrorMessage ()
string getErrorMessageFile ()
void setErrorCode (string $code)
void setErrorMessage (string $message)
string translateErrorMessage (string $key)
Methods
Constructor __construct (line 46)

Constructor.

- access: public

TException __construct (string $errorMessage)

- string $errorMessage: error message. This can be a string that is listed in the message file. If so, the message in the preferred language will be used as the error message. Any rest parameters will be used to replace placeholders ({0}, {1}, {2}, etc.) in the message.

Redefined in descendants as:

- TPhpErrorException::__construct() : Constructor.
- THttpException::__construct() : Constructor.

getErrorCode (line 96)

- return: error code
- access: public

string getErrorCode ()
getErrorMessage (line 112)

- return: error message
- access: public

string getErrorMessage ()
getErrorMessageFile (line 84)

- return: path to the error message file
- access: protected

string getErrorMessageFile ()
setErrorCode (line 104)

- access: public

void setErrorCode (string $code)

- string $code: error code

setErrorMessage (line 120)

- access: protected

void setErrorMessage (string $message)

- string $message: error message

translateErrorMessage (line 64)

Translates an error code into an error message.

- return: the translated error message
- access: protected

string translateErrorMessage (string $key)

- string $key: error code that is passed in the exception constructor.

Documentation generated on Sun, 04 Jun 2006 18:59:21 -0400 by phpDocumentor 1.3.0RC4