API > eden > error.php
View Source

class Eden_Error

The base class for any class handling exceptions. Exceptions allow an application to custom handle errors that would normally let the system handle. This exception allows you to specify error levels and error types. Also using this exception outputs a trace (can be turned off) that shows where the problem started to where the program stopped.

Constants

  • REFLECTION_ERROR: Error creating Reflection Class: %s, Method: %s.
  • INVALID_ARGUMENT: Argument %d in %s() was expecting %s, however %s was given.
  • ARGUMENT: ARGUMENT //used when argument is invalidated
  • LOGIC: LOGIC //used when logic is invalidated
  • GENERAL: GENERAL //used when anything in general is invalidated
  • CRITICAL: CRITICAL //used when anything caused application to crash
  • WARNING: WARNING
  • ERROR: ERROR
  • DEBUG: DEBUG //used for temporary developer output
  • INFORMATION: INFORMATION //used for permanent developer notes
  • DEBUG_NOT_STRING: Debug was expecting a string
  • DEBUG_NOT_PROPERTY: Debug: %s is not a property of %s

Public Methods

public function addVariable($variable)

Adds parameters used in the message

Returns this

public function argument($index, $types)

Tests arguments for valid data types

Arguments

  1. *int
  2. *mixed
  3. *string[,string..]

Returns this

public function getLevel()

Returns the exception level

Returns string

public function getRawTrace()

Returns raw trace

Returns array

public function getReporter()

REturns the class or method that caught this

Returns string

public function getTraceOffset()

Returns the trace offset; where we should start the trace

Returns this

public function getType()

Returns the exception type

Returns string

public function getVariables()

Returns variables

Returns array

public function noArgTest()

In a perfect production environment, we can assume that arguments passed in all methods are valid. To increase performance call this method.

Returns this

public function setLevel($level)

Sets exception level

Arguments

  1. string

Returns this

public function setLevelDebug()

Sets exception level to DEBUG

Returns this

public function setLevelError()

Sets exception level to ERROR

Returns this

public function setLevelInformation()

Sets exception level to INFORMATION

Returns this

public function setLevelWarning()

Sets exception level to WARNING

Returns this

public function setMessage($message)

Sets message

Arguments

  1. string

Returns this

public function setTraceOffset($offset)

Sets what index the trace should start at

Returns this

public function setType($type)

Sets exception type

Arguments

  1. string

Returns this

public function setTypeArgument()

Sets exception type to ARGUMENT

Returns this

public function setTypeCritical()

Sets exception type to CRITICAL

Returns this

public function setTypeGeneral()

Sets exception type to GENERAL

Returns this

public function setTypeLogic()

Sets exception type to LOGIC

Returns this

public function trigger()

Combines parameters with message and throws it

Returns void

public function vargument($method, $args, $index, $types)

Tests virtual arguments for valid data types

Arguments

  1. *int
  2. *mixed
  3. *string[,string..]

Returns this


© 2012 Openovate Labs. All rights reserved.