SOURCES: eventum-errorhandler.patch - attempt to fetch DB error wh...

glen glen at pld-linux.org
Tue Mar 13 23:22:47 CET 2007


Author: glen                         Date: Tue Mar 13 22:22:47 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- attempt to fetch DB error while trimming

---- Files affected:
SOURCES:
   eventum-errorhandler.patch (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SOURCES/eventum-errorhandler.patch
diff -u SOURCES/eventum-errorhandler.patch:1.2 SOURCES/eventum-errorhandler.patch:1.3
--- SOURCES/eventum-errorhandler.patch:1.2	Tue Mar 13 22:57:51 2007
+++ SOURCES/eventum-errorhandler.patch	Tue Mar 13 23:22:42 2007
@@ -1,5 +1,3 @@
-Index: include/class.mail_queue.php
-===================================================================
 --- include/class.mail_queue.php	(revision 3278)
 +++ include/class.mail_queue.php	(working copy)
 @@ -236,11 +236,9 @@
@@ -17,10 +15,8 @@
              return $res;
          } else {
              return true;
-Index: include/class.error_handler.php
-===================================================================
---- include/class.error_handler.php	(revision 3278)
-+++ include/class.error_handler.php	(working copy)
+--- include/class.error_handler.php	(working copy)
++++ include/class.error_handler.php	2007-03-14 00:15:44.804500919 +0200
 @@ -32,8 +32,6 @@
  require_once(APP_INC_PATH . "class.mail.php");
  require_once(APP_INC_PATH . "class.setup.php");
@@ -30,7 +26,7 @@
  /**
   * Class to manage all tasks related to error conditions of the site, such as
   * logging facilities or alert notifications to the site administrators.
-@@ -45,126 +43,159 @@
+@@ -45,126 +43,167 @@
  class Error_Handler
  {
      /**
@@ -192,7 +188,15 @@
 +        }
 +
 +        if (strlen($error_msg) > 1024) {
-+            $msg .= "'" . substr($error_msg, 0, 1024) . "' (truncated)\n";
++            $msg .= "'" . substr($error_msg, 0, 1024) . "' ...";
++
++            // try to find native code from DB error
++            // [nativecode=1153 ** Got a packet bigger than 'max_allowed_packet' bytes]'
++            $nativecode = strstr($error_msg, '[nativecode=');
++            if ($nativecode) {
++                $msg .= ' ' . $nativecode;
++            }
++            $msg .= "\n";
          } else {
 -            $msg .= "'$error_msg'\n\n";
 +            $msg .= "'" . $error_msg . "'\n";
@@ -213,6 +217,10 @@
 -            $contents = ob_get_contents();
 -            $msg .= $contents;
 -            ob_end_clean();
+-        }
+-        $fp = @fopen(APP_ERROR_LOG, "a");
+-        @fwrite($fp, $msg);
+-        @fclose($fp);
 +            array_splice($backtrace, 0, 2);
 +
 +            // we process backtrace to truncate large blobs
@@ -253,10 +261,7 @@
 +            }
 +
 +            $msg .= "\n\n";
-         }
--        $fp = @fopen(APP_ERROR_LOG, "a");
--        @fwrite($fp, $msg);
--        @fclose($fp);
++        }
 +        return $msg;
      }
  }
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/eventum-errorhandler.patch?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list