Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / migrate / src / Audit / AuditException.php
diff --git a/web/core/modules/migrate/src/Audit/AuditException.php b/web/core/modules/migrate/src/Audit/AuditException.php
new file mode 100644 (file)
index 0000000..d2ef2eb
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+namespace Drupal\migrate\Audit;
+
+use Drupal\migrate\Plugin\MigrationInterface;
+
+/**
+ * Defines an exception to throw if an error occurs during a migration audit.
+ */
+class AuditException extends \RuntimeException {
+
+  /**
+   * AuditException constructor.
+   *
+   * @param \Drupal\migrate\Plugin\MigrationInterface $migration
+   *   The migration that caused the exception.
+   * @param string $message
+   *   The reason the audit failed.
+   * @param \Exception $previous
+   *   (optional) The previous exception.
+   */
+  public function __construct(MigrationInterface $migration, $message, \Exception $previous = NULL) {
+    $message = sprintf('Cannot audit migration %s: %s', $migration->id(), $message);
+    parent::__construct($message, 0, $previous);
+  }
+
+}