5 * Provides a simple error class for Savant.
9 * @author Paul M. Jones <pmjones@ciaweb.net>
11 * @license http://www.gnu.org/copyleft/lesser.html LGPL
13 * @version $Id: Error.php,v 1.5 2005/05/27 14:03:50 pmjones Exp $
19 * Provides a simple error class for Savant.
23 * @author Paul M. Jones <pmjones@ciaweb.net>
31 * The error code, typically a Savant 'ERR_*' string.
42 * An array of error-specific information.
49 public $info = array ();
53 * The error severity level.
60 public $level = E_USER_ERROR
;
64 * A debug backtrace for the error, if any.
80 * An associative array where the key is a
81 * Savant3_Error property and the value is the value for that
85 public function __construct($conf = array()) {
86 // set public properties
87 foreach ( $conf as $key => $val ) {
92 if ($conf ['trace'] === true) {
93 $this->trace
= debug_backtrace ();
99 * Magic method for output dump.
105 public function __toString() {
107 echo get_class ( $this ) . ': ';
108 print_r ( get_object_vars ( $this ) );
109 return ob_get_clean ();