]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/exceptions/class_FrameworkException.php
Image generator added, first CAPTCHA added with missing controller (partly work)
[shipsimu.git] / inc / classes / exceptions / class_FrameworkException.php
index 34e48023f10574ef46ed46bae26509f22e941384..c36ba093884239f71344099fb42604139538f6de 100644 (file)
@@ -29,6 +29,11 @@ abstract class FrameworkException extends ReflectionException {
         */
        private $backTrace = array();
 
+       /**
+        * Extra data
+        */
+       private $extraData = "";
+
        /**
         * The super constructor for all exceptions
         *
@@ -44,6 +49,19 @@ abstract class FrameworkException extends ReflectionException {
                $message = (string) $message;
                $code    = (int)    $code;
 
+               // In emergency exit?
+               if (defined('EMERGENCY_EXIT_CALLED')) {
+                       // Output message
+                       printf("[%s:] Message: %s, Backtrace: <pre>%s</pre>",
+                               $this->__toString(),
+                               $message,
+                               $this->getPrintableBackTrace()
+                       );
+
+                       // End here
+                       exit;
+               } // END - if
+
                // Make sure everything is assigned properly
                parent::__construct($message, $code);
        }
@@ -150,6 +168,25 @@ abstract class FrameworkException extends ReflectionException {
                // Return it
                return $hexCode;
        }
+
+       /**
+        * Setter for extra data
+        *
+        * @param       $extraData      Extra data to store
+        * @return      void
+        */
+       protected final function setExtraData ($extraData) {
+               $this->extraData = $extraData;
+       }
+
+       /**
+        * Getter for extra data
+        *
+        * @return      $extraData      Extra data to store
+        */
+       public final function getExtraData () {
+               return $this->extraData;
+       }
 }
 
 // [EOF]