Piwik\Updater\Migration::shouldIgnoreError PHP Method

shouldIgnoreError() public method

Decides whether an error should be ignored or not.
public shouldIgnoreError ( Exception $exception ) : boolean
$exception Exception
return boolean
    public function shouldIgnoreError($exception)
    {
        return false;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @param $file
  * @param Migration $migration
  * @throws UpdaterErrorException
  * @api
  */
 public function executeMigration($file, Migration $migration)
 {
     try {
         $this->executeListenerHook('onStartExecutingMigration', array($file, $migration));
         $migration->exec();
     } catch (\Exception $e) {
         if (!$migration->shouldIgnoreError($e)) {
             $message = sprintf("%s:\nError trying to execute the migration '%s'.\nThe error was: %s", $file, $migration->__toString(), $e->getMessage());
             throw new UpdaterErrorException($message);
         }
     }
     $this->executeListenerHook('onFinishedExecutingMigration', array($file, $migration));
 }