Mercurial > hg > isophonics-drupal-site
annotate core/modules/migrate/src/Audit/AuditException.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 1fec387a4317 |
children |
rev | line source |
---|---|
Chris@14 | 1 <?php |
Chris@14 | 2 |
Chris@14 | 3 namespace Drupal\migrate\Audit; |
Chris@14 | 4 |
Chris@14 | 5 use Drupal\migrate\Plugin\MigrationInterface; |
Chris@14 | 6 |
Chris@14 | 7 /** |
Chris@14 | 8 * Defines an exception to throw if an error occurs during a migration audit. |
Chris@14 | 9 */ |
Chris@14 | 10 class AuditException extends \RuntimeException { |
Chris@14 | 11 |
Chris@14 | 12 /** |
Chris@14 | 13 * AuditException constructor. |
Chris@14 | 14 * |
Chris@14 | 15 * @param \Drupal\migrate\Plugin\MigrationInterface $migration |
Chris@14 | 16 * The migration that caused the exception. |
Chris@14 | 17 * @param string $message |
Chris@14 | 18 * The reason the audit failed. |
Chris@14 | 19 * @param \Exception $previous |
Chris@14 | 20 * (optional) The previous exception. |
Chris@14 | 21 */ |
Chris@14 | 22 public function __construct(MigrationInterface $migration, $message, \Exception $previous = NULL) { |
Chris@14 | 23 $message = sprintf('Cannot audit migration %s: %s', $migration->id(), $message); |
Chris@14 | 24 parent::__construct($message, 0, $previous); |
Chris@14 | 25 } |
Chris@14 | 26 |
Chris@14 | 27 } |