Skip to content

Commit 820c097

Browse files
author
Carlos Lizaga
committed
Fine tuning: add use Magento\Framework\Exception\LocalizedException in
order to use LocalizedException.
1 parent dc22a82 commit 820c097

File tree

1 file changed

+6
-5
lines changed
  • app/code/Magento/CatalogImportExport/Model/Import

1 file changed

+6
-5
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Catalog\Model\Product\Visibility;
1010
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as ValidatorInterface;
1111
use Magento\Framework\App\Filesystem\DirectoryList;
12+
use Magento\Framework\Exception\LocalizedException;
1213
use Magento\Framework\Filesystem;
1314
use Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor;
1415
use Magento\Framework\Model\ResourceModel\Db\TransactionManagerInterface;
@@ -1084,12 +1085,12 @@ protected function _initTypeModels()
10841085
$params = [$this, $productTypeName];
10851086
if (!($model = $this->_productTypeFactory->create($productTypeConfig['model'], ['params' => $params]))
10861087
) {
1087-
throw new \Magento\Framework\Exception\LocalizedException(
1088+
throw new LocalizedException(
10881089
__('Entity type model \'%1\' is not found', $productTypeConfig['model'])
10891090
);
10901091
}
10911092
if (!$model instanceof \Magento\CatalogImportExport\Model\Import\Product\Type\AbstractType) {
1092-
throw new \Magento\Framework\Exception\LocalizedException(
1093+
throw new LocalizedException(
10931094
__(
10941095
'Entity type model must be an instance of '
10951096
. \Magento\CatalogImportExport\Model\Import\Product\Type\AbstractType::class
@@ -1612,7 +1613,7 @@ protected function _saveProducts()
16121613

16131614
// wrong attribute_set_code was received
16141615
if (!$attributeSetId) {
1615-
throw new \Magento\Framework\Exception\LocalizedException(
1616+
throw new LocalizedException(
16161617
__(
16171618
'Wrong attribute set code "%1", please correct it and try again.',
16181619
$rowData['attribute_set_code']
@@ -1999,7 +2000,7 @@ protected function _getUploader()
19992000
}
20002001

20012002
if (!$this->_fileUploader->setTmpDir($tmpPath)) {
2002-
throw new \Magento\Framework\Exception\LocalizedException(
2003+
throw new LocalizedException(
20032004
__('File directory \'%1\' is not readable.', $tmpPath)
20042005
);
20052006
}
@@ -2008,7 +2009,7 @@ protected function _getUploader()
20082009

20092010
$this->_mediaDirectory->create($destinationPath);
20102011
if (!$this->_fileUploader->setDestDir($destinationPath)) {
2011-
throw new \Magento\Framework\Exception\LocalizedException(
2012+
throw new LocalizedException(
20122013
__('File directory \'%1\' is not writable.', $destinationPath)
20132014
);
20142015
}

0 commit comments

Comments
 (0)