+function ffExceptionHandler($e) {
+ global $sysdebug__aborted;
+
+ /* drop output buffers and error handler */
+ $sysdebug__aborted = true;
+ while (ob_get_length() > 0 && ob_end_clean()) {
+ /* loop */ ;
+ }
+ restore_error_handler();
+
+ /* issue exception information */
+ header('HTTP/1.0 500 Exception not handled');
+ header('Content-type: text/plain');
+ echo "\r\nUncaught exception:\n" . str_replace("\r", "",
+ $e->getMessage() . "\n\nBacktrace:\n" . $e->getTraceAsString()) .
+ "\n";
+ exit(1);
+}
+
+