5 * @author Sebastian Skejø
8 class AOOSException
extends Exception
10 private $_core = null;
11 private $_name = null;
13 private $_trace = null;
14 private $_ecode = null;
16 public function __construct($core, $name, $msg="", $doTrace=true, $code = 0)
23 $this->_trace
= debug_backtrace();
25 if ($code > 2 ||
$code < 0)
27 throw new AOOSException($core, $core->tr("exception_code_error"));
30 $this->_ecode
= $code;
31 $this->_core
->setException($this);
34 public function __toString()
40 $str .= "fatal_error";
49 $str .= "</strong>: ".$this->_name
."<br /><div style='font-size: 10pt;'>".$this->_msg
."</div><br /><div style='font-size: 10pt; color: #aaa'>";
50 foreach ($this->_trace
as $row)
52 if (isset($row["class"]))
54 if ($row["class"] == "AOOSException")
58 $str .= "<strong>".$row["class"]."->".$row["function"]."</strong> in ".$row["file"]." on line ".$row["line"]."<br />";
65 public function getName() { return $this->_name
; }
66 public function getMsg() { return $this->_msg
; }
67 public function getEcode() { return $this->_ecode
; }