You are here

function _debug_error_handler in Advertisement 5.2

Same name and namespace in other branches
  1. 6.3 adserve.inc \_debug_error_handler()
  2. 6.2 adserve.inc \_debug_error_handler()
  3. 7 adserve.inc \_debug_error_handler()

When debugging, strip away distracting header errors. Dump all other errors.

1 string reference to '_debug_error_handler'
_debug_echo in ./adserve.inc
Dump debug message to screen; set custom error handler.

File

./adserve.inc, line 190

Code

function _debug_error_handler($errno, $errstr, $errfile = NULL, $errline = 0, $errcontext = NULL) {
  if (!preg_match('/Cannot modify header information/', $errstr) && !preg_match('/Cannot send session cache limiter/', $errstr)) {
    echo "PHP: errno({$errno}): {$errstr} ";
    if ($errfile && $errline) {
      echo "; Line {$errline} in [{$errfile}]";
    }
    echo "<br />\n";
    if (!empty($errcontext) && adserve_variable('debug') >= 5) {
      echo 'Error context:<pre>';
      print_r($errcontext);
      echo '</pre>';
    }
  }
}