You are here

public static function FeedImport::errorHandler in Feed Import 7.2

Same name and namespace in other branches
  1. 7 feed_import.inc.php \FeedImport::errorHandler()

Error handler callback This is setted with set_error_handling()

File

./feed_import.inc.php, line 191
Feed import class for parsing and processing content.

Class

FeedImport
@file Feed import class for parsing and processing content.

Code

public static function errorHandler($errno, $errmsg, $file, $line) {

  // How many errors to display.
  $errors_left =& drupal_static(__CLASS__ . '::' . __FUNCTION__, 100);

  // Handle silenced errors with @.
  if (error_reporting() == 0) {
    return FALSE;
  }

  // Add error to reports.
  if ($errors_left > 0) {
    self::$report['errors'][] = array(
      'error' => $errmsg,
      'error number' => $errno,
      'line' => $line,
      'file' => $file,
    );
    $errors_left--;
  }

  // Throw an exception to be caught by a try-catch statement.
  throw new Exception('Uncaught Feed Import Exception', $errno);
}