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)
24 $this->_trace
= debug_backtrace();
26 if ($code > 2 ||
$code < 0)
28 throw new AOOSException($core, $core->tr("exception_code_error"));
31 $this->_ecode
= $code;
32 $this->core()->setException($this);
35 public function __toString()
41 $str .= "fatal_error";
50 $str .= "</strong>: ".$this->_name
."<br /><div style='font-size: 10pt;'>".$this->_msg
."</div><br /><div style='font-size: 10pt; color: #aaa'>";
51 foreach ($this->_trace
as $row)
53 if (isset($row["class"]))
55 if ($row["class"] == "AOOSException")
59 $str .= "<strong>".$row["class"]."->".$row["function"]."</strong> in ".$row["file"]." on line ".$row["line"]."<br />";
66 public function getName() { return $this->_name
; }
67 public function getMsg() { return $this->_msg
; }
68 public function getEcode() { return $this->_ecode
; }
69 public function core() { return $this->_core
; }