shouldIgnoreError() public method

Decides whether an error should be ignored or not.
public shouldIgnoreError ( Exception $exception ) : boolean
$exception Exception
return boolean
コード例 #1
0
ファイル: Updater.php プロジェクト: piwik/piwik
 /**
  * @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));
 }