You are here

public function FeedImportProcessor::setErrorHandler in Feed Import 7.3

Enables/disables error handler.

Parameters

bool $enable: Whatever to enable or disable the error handler

File

feed_import_base/inc/feed_import.inc, line 683
This file contains Feed Import helpers.

Class

FeedImportProcessor
Class that processess the import.

Code

public function setErrorHandler($enable) {
  if ($enable) {
    if (!$this->errHandlerEnabled) {

      // Set error handler.
      $this->errHandlerEnabled = TRUE;
      set_error_handler(array(
        $this,
        'errorHandler',
      ));
    }
  }
  elseif ($this->errHandlerEnabled) {

    // Resore eror handler.
    $this->errHandlerEnabled = FALSE;
    restore_error_handler();
  }
}