## 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: $Id: TException.php 2541 2008-10-21 15:05:13Z qiang.xue $
- author: Qiang Xue <qiang.xue@gmail.com>

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

    Exception
       |
       --TException

Direct descendents

Class | Description
--- | ---
TSqlMapException | TSqlMapException is the base exception class for all SqlMap exceptions.
TSystemException | TSystemException class
TApplicationException | TApplicationException class
TInvalidCallbackException | TInvalidCallbackException class.

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:

- TSqlMapException::__construct() : Constructor, similar to the parent constructor. For parameters that are of SimpleXmlElement, the tag name and its attribute names and values are expanded into a string.
- TPhpErrorException::__construct() : Constructor.
- THttpException::__construct() : Constructor.

getErrorCode (line 94)

- return: error code
- access: public

string getErrorCode ()
getErrorMessage (line 110)

- return: error message
- access: public

string getErrorMessage ()
getErrorMessageFile (line 82)

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

string getErrorMessageFile ()

Redefined in descendants as:

- TSqlMapException::getErrorMessageFile()
- TActiveRecordException::getErrorMessageFile()

setErrorCode (line 102)

- access: public

void setErrorCode (string $code)

- string $code: error code

setErrorMessage (line 118)

- 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, 11 Jan 2009 20:22:30 -0500 by phpDocumentor 1.3.0RC4