2 // @title Extension Exception class
3 // @author Matt Todd <matt@matttoddphoto.com>
5 // @desc An Exception class specifically for 3rd party extensions (to be extended)
7 class ExtException
extends Exception
{
10 public $strErrorMessage;
11 public $strErrorLocation;
12 public $strErrorContext;
16 public function __construct($nErrorCode = "0099", $strErrorMessage = "Undefined", $strErrorLocation = "", $strErrorContext = "", $aDump = "") {
17 $this->nErrorCode
= $nErrorCode;
18 $this->strErrorMessage
= $strErrorMessage;
19 $this->strErrorLocation
= $strErrorLocation;
20 $this->strErrorContext
= $strErrorContext;
21 $this->aDump
= $aDump;
25 public function GetErrorCode() {
26 return $this->nErrorCode
;
28 public function GetErrorMessage() {
29 return $this->strErrorMessage
;
31 public function GetErrorLocation() {
32 return $this->strErrorLocation
;
34 public function GetErrorContext() {
35 return $this->strErrorContext
;
37 public function GetDump() {
40 public function AsString($bHTML = false) {
42 return "<strong>Error No. {$this->strErrorCode}</strong>: {$this->strErrorMessage} (<em>{$this->strErrorLocation}</em>)";
44 return "Error No. {$this->strErrorCode}: {$this->strErrorMessage} ({$this->strErrorLocation})";
49 public function GetError() {
50 return "Error No. " . $this->GetErrorCode() . ": " . $this->GetErrorMessage();