Commit 03953a6f authored by AaronBauman's avatar AaronBauman Committed by andypost

Issue #2870422 by aaronbauman, larowlan: Exception messages should not use FormattableMarkup

parent 8ce6a8f9
......@@ -132,10 +132,10 @@ class Exporter implements ExporterInterface {
$entity = $storage->load($entity_id);
if (!$entity) {
throw new \InvalidArgumentException(new FormattableMarkup('Entity @type with ID @id does not exist', ['@type' => $entity_type_id, '@id' => $entity_id]));
throw new \InvalidArgumentException(sprintf('Entity "%s" with ID "%s" does not exist', $entity_type_id, $entity_id));
}
if (!($entity instanceof ContentEntityInterface)) {
throw new \InvalidArgumentException(new FormattableMarkup('Entity @type with ID @id should be a content entity', ['@type' => $entity_type_id, '@id' => $entity_id]));
throw new \InvalidArgumentException(sprintf('Entity "%s" with ID "%s" should be a content entity', $entity_type_id, $entity_id));
}
$entities = [$entity->uuid() => $entity];
......
......@@ -143,14 +143,9 @@ class Importer implements ImporterInterface {
// Throw an exception when this UUID already exists.
if (isset($file_map[$item_uuid])) {
$args = [
'@uuid' => $item_uuid,
'@first' => $file_map[$item_uuid]->uri,
'@second' => $file->uri,
];
// Reset link domain.
$this->linkManager->setLinkDomain(FALSE);
throw new \Exception(new FormattableMarkup('Default content with uuid @uuid exists twice: @first @second', $args));
throw new \Exception(sprintf('Default content with uuid "%s" exists twice: "%s" "%s"', $item_uuid, $file_map[$item_uuid]->uri, $file->uri));
}
// Store the entity type with the file.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment