mirror of
https://github.com/code-rhapsodie/ezmigrationbundle2.git
synced 2026-03-24 14:52:13 +01:00
21 lines
714 B
PHP
21 lines
714 B
PHP
<?php
|
|
|
|
namespace Kaliop\eZMigrationBundle\API\Exception;
|
|
|
|
use Kaliop\eZMigrationBundle\API\Value\Migration;
|
|
|
|
/**
|
|
* Throw this exception in any step to abort the migration and mark it as finished in either DONE or SKIPPED status
|
|
*/
|
|
class MigrationAbortedException extends \Exception
|
|
{
|
|
public function __construct($message = "", $status = Migration::STATUS_DONE, \Exception $previous = null)
|
|
{
|
|
if ($status !== Migration::STATUS_DONE && $status !== Migration::STATUS_SKIPPED && $status !== Migration::STATUS_FAILED) {
|
|
throw new \Exception("Unsupported migration status $status in MigrationAbortedException");
|
|
}
|
|
|
|
parent::__construct($message, $status, $previous);
|
|
}
|
|
}
|