\patError

patError error object used by the patFormsError manager as error messages container for precise error management.

$Id: patError.php,v 1.5 2004/04/17 20:29:56 schst Exp $

Summary

Methods
Properties
Constants
__construct()
patError()
getLevel()
getMessage()
getInfo()
getCode()
getBacktrace()
getFile()
getLine()
$level
$code
$message
$info
$file
$line
$function
$class
$type
$args
$backtrace
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$level

$level : string

stores the error level for this error

Type

string

$code

$code : string

stores the code of the error

Type

string

$message

$message : string

stores the error message - this is the message that can also be shown the user if need be.

Type

string

$info

$info : string

additional info that is relevant for the developer of the script (e.g. if a database connect fails, the dsn used) and that the end-user should not see.

Type

string

$file

$file : string

stores the filename of the file the error occurred in.

Type

string

$line

$line : integer

stores the line number the error occurred in.

Type

integer

$function

$function : string

stores the name of the method the error occurred in

Type

string

$class

$class : string

stores the name of the class (if any) the error occurred in.

Type

string

$type

$type : string

stores the type of error, as it is listed in the error backtrace

Type

string

$args

$args : array

stores the arguments the method that the error occurred in had received.

Type

array

$backtrace

$backtrace : mixed

stores the complete debug backtrace (if your PHP version has the debug_backtrace function)

Type

mixed

Methods

__construct()

__construct(integer  $level, string  $code, string  $msg, string  $info = null) 

constructor, wrapper for the upcoming PHP5 constructors for upward compatibility.

Parameters

integer $level

The error level (use the PHP constants E_ALL, E_NOTICE etc.).

string $code

The error code from the application

string $msg

The error message

string $info

Optional: The additional error information.

patError()

patError(integer  $level, string  $code, string  $msg, string  $info = null) 

constructor - used to set up the error with all needed error details.

Parameters

integer $level

The error level (use the PHP constants E_ALL, E_NOTICE etc.).

string $code

The error code from the application

string $msg

The error message

string $info

Optional: The additional error information.

getLevel()

getLevel() : integer

returns the error level of the error - corresponds to the PHP error levels (E_ALL, E_NOTICE.

..)

Returns

integer —

$level The error level

getMessage()

getMessage() : string

retrieves the error message

Returns

string —

$msg The stored error message

getInfo()

getInfo() : mixed

retrieves the additional error information (information usually only relevant for developers)

Returns

mixed —

$info The additional information

getCode()

getCode() : string|integer

recieve error code

Returns

string|integer —

error code (may be a string or an integer)

getBacktrace()

getBacktrace() : array

get the backtrace

This is only possible, if debug_backtrace() is available.

Returns

array —

backtrace

getFile()

getFile() : string

get the filename in which the error occured

This is only possible, if debug_backtrace() is available.

Returns

string —

filename

getLine()

getLine() : integer

get the line number in which the error occured

This is only possible, if debug_backtrace() is available.

Returns

integer —

line number