]> git.mxchange.org Git - hub.git/blobdiff - application/hub/exceptions.php
Initial coding of hub node-mode.
[hub.git] / application / hub / exceptions.php
index 69284bdcc8239d41224fc6aaa79448b20f1df5ef..c8fcdcb275a09cc5b435f5d832bcdd0ccea58528 100644 (file)
@@ -32,14 +32,14 @@ function hub_exception_handler ($exceptionInstance) {
                // Get 3 call levels
                $backTrace = "";
                for ($idx = 0; $idx < 3; $idx++) {
+                       // Copy array for argument analysis and init variable
                        $traceArray = $trace[$idx];
+                       $argsString = "";
 
                        // Convert arguments type into human-readable
-                       $args = $traceArray['args'];
-                       $argsString = "";
-                       foreach ($args as $arg) {
-                               $argsString .= ", ".gettype($arg);
-                       }
+                       foreach ($traceArray['args'] as $arg) {
+                               $argsString .= ", " . gettype($arg);
+                       } // END - foreach
                        $argsString = substr($argsString, 2);
 
                        $backTrace .= sprintf("---------- Pos %d: ----------
@@ -55,7 +55,7 @@ Line   : %d\n",
                                basename($traceArray['file']),
                                $traceArray['line']
                        );
-               }
+               } // END - for
 
                // Construct the message
                $message = sprintf("--------------------------------------------------------------------------------
@@ -79,7 +79,12 @@ Backtrace:
                );
 
                // Output the message
-               print $message;
+               print($message);
+       } else {
+               // Invalid exception instance detected! Do *only* throw exceptions that
+               // extends our own exception 'FrameworkException' to get such nice
+               // outputs like above.
+               print("exceptionInstance is invalid! Please inform the core developer team.\n");
        }
 }