You are here

public static function FeedImport::errorHandler in Feed Import 7

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

Error handler callback This is setted with set_error_handling()

File

./feed_import.inc.php, line 193
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
  static $errors_left = 100;

  // 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 try-catch
  throw new Exception(t('Uncaught Feed Import Exception'));
}