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 2606 2009-02-11 15:24:27Z haertl.mike $
  • 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.
Variable Summary
Method Summary
TException __construct (string $errorMessage)
string getErrorCode ()
string getErrorMessage ()
void setErrorCode (string $code)
void setErrorMessage (string $message)
string translateErrorMessage (string $key)
Variables
mixed $_messageCache = array() (line 38)
  • static:
Methods
Constructor __construct (line 47)

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:
getErrorCode (line 99)
  • return: error code
  • access: public
string getErrorCode ()
getErrorMessage (line 115)
  • return: error message
  • access: public
string getErrorMessage ()
getErrorMessageFile (line 87)
  • return: path to the error message file
  • access: protected
string getErrorMessageFile ()

Redefined in descendants as:
setErrorCode (line 107)
  • access: public
void setErrorCode (string $code)
  • string $code: error code
setErrorMessage (line 123)
  • access: protected
void setErrorMessage (string $message)
  • string $message: error message
translateErrorMessage (line 65)

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, 24 May 2009 16:47:33 -0400 by phpDocumentor 1.3.0RC4