Skip to content

Commit 4573c0e

Browse files
author
Dmytro Poperechnyy
committed
Merge remote-tracking branch 'tango/MAGETWO-26762' into MAGETWO-34995
2 parents a2ebda1 + 26719fd commit 4573c0e

File tree

30 files changed

+68
-117
lines changed

30 files changed

+68
-117
lines changed

app/code/Magento/Backup/Exception.php

Lines changed: 0 additions & 10 deletions
This file was deleted.

app/code/Magento/Backup/Model/Backup.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,20 +273,22 @@ public function deleteFile()
273273
*
274274
* @param bool $write
275275
* @return $this
276-
* @throws \Magento\Backup\Exception
276+
* @throws \Magento\Framework\Exception\InputException
277277
* @throws \Magento\Framework\Backup\Exception\NotEnoughPermissions
278278
*/
279279
public function open($write = false)
280280
{
281281
if ($this->getPath() === null) {
282-
throw new \Magento\Backup\Exception(__('The backup file path was not specified.'));
282+
throw new \Magento\Framework\Exception\InputException(__('The backup file path was not specified.'));
283283
}
284284

285285
if ($write && $this->varDirectory->isFile($this->_getFilePath())) {
286286
$this->varDirectory->delete($this->_getFilePath());
287287
}
288288
if (!$write && !$this->varDirectory->isFile($this->_getFilePath())) {
289-
throw new \Magento\Backup\Exception(__('The backup file "%1" does not exist.', $this->getFileName()));
289+
throw new \Magento\Framework\Exception\InputException(
290+
__('The backup file "%1" does not exist.', $this->getFileName())
291+
);
290292
}
291293

292294
$mode = $write ? 'wb' . self::COMPRESS_RATE : 'rb';
@@ -311,12 +313,12 @@ public function open($write = false)
311313
* Get zlib handler
312314
*
313315
* @return \Magento\Framework\Filesystem\File\WriteInterface
314-
* @throws \Magento\Backup\Exception
316+
* @throws \Magento\Framework\Exception\InputException
315317
*/
316318
protected function _getStream()
317319
{
318320
if ($this->_stream === null) {
319-
throw new \Magento\Backup\Exception(__('The backup file handler was unspecified.'));
321+
throw new \Magento\Framework\Exception\InputException(__('The backup file handler was unspecified.'));
320322
}
321323
return $this->_stream;
322324
}
@@ -347,14 +349,14 @@ public function eof()
347349
*
348350
* @param string $string
349351
* @return $this
350-
* @throws \Magento\Backup\Exception
352+
* @throws \Magento\Framework\Exception\InputException
351353
*/
352354
public function write($string)
353355
{
354356
try {
355357
$this->_getStream()->write($string);
356358
} catch (\Magento\Framework\Filesystem\FilesystemException $e) {
357-
throw new \Magento\Backup\Exception(
359+
throw new \Magento\Framework\Exception\InputException(
358360
__('Something went wrong writing to the backup file "%1".', $this->getFileName())
359361
);
360362
}

app/code/Magento/Catalog/Exception.php

Lines changed: 0 additions & 10 deletions
This file was deleted.

app/code/Magento/Catalog/Model/Indexer/Product/Eav/Action/Full.php

100644100755
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ class Full extends \Magento\Catalog\Model\Indexer\Product\Eav\AbstractAction
1515
*
1616
* @param array|int|null $ids
1717
* @return void
18-
* @throws \Magento\Catalog\Exception
18+
* @throws \Magento\Framework\Exception\LocalizedException
19+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
1920
*/
2021
public function execute($ids = null)
2122
{
2223
try {
2324
$this->reindex();
2425
} catch (\Exception $e) {
25-
throw new \Magento\Catalog\Exception($e->getMessage(), $e->getCode(), $e);
26+
throw new \Magento\Framework\Exception\LocalizedException(__($e->getMessage()), $e);
2627
}
2728
}
2829
}

app/code/Magento/Catalog/Model/Indexer/Product/Eav/Action/Row.php

100644100755
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@ class Row extends \Magento\Catalog\Model\Indexer\Product\Eav\AbstractAction
1515
*
1616
* @param int|null $id
1717
* @return void
18-
* @throws \Magento\Catalog\Exception
18+
* @throws \Magento\Framework\Exception\InputException
19+
* @throws \Magento\Framework\Exception\LocalizedException
1920
*/
2021
public function execute($id = null)
2122
{
2223
if (!isset($id) || empty($id)) {
23-
throw new \Magento\Catalog\Exception(__('Could not rebuild index for undefined product'));
24+
throw new \Magento\Framework\Exception\InputException(__('Could not rebuild index for undefined product'));
2425
}
2526
try {
2627
$this->reindex($id);
2728
} catch (\Exception $e) {
28-
throw new \Magento\Catalog\Exception($e->getMessage(), $e->getCode(), $e);
29+
throw new \Magento\Framework\Exception\LocalizedException(__($e->getMessage()), $e);
2930
}
3031
}
3132
}

app/code/Magento/Catalog/Model/Indexer/Product/Eav/Action/Rows.php

100644100755
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@ class Rows extends \Magento\Catalog\Model\Indexer\Product\Eav\AbstractAction
1515
*
1616
* @param array $ids
1717
* @return void
18-
* @throws \Magento\Catalog\Exception
18+
* @throws \Magento\Framework\Exception\InputException
19+
* @throws \Magento\Framework\Exception\LocalizedException
1920
*/
2021
public function execute($ids)
2122
{
2223
if (empty($ids)) {
23-
throw new \Magento\Catalog\Exception(__('Bad value was supplied.'));
24+
throw new \Magento\Framework\Exception\InputException(__('Bad value was supplied.'));
2425
}
2526
try {
2627
$this->reindex($ids);
2728
} catch (\Exception $e) {
28-
throw new \Magento\Catalog\Exception($e->getMessage(), $e->getCode(), $e);
29+
throw new \Magento\Framework\Exception\LocalizedException(__($e->getMessage()), $e);
2930
}
3031
}
3132
}

app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,13 @@ public function getTypeIndexers()
365365
*
366366
* @param string $productTypeId
367367
* @return \Magento\Catalog\Model\Resource\Product\Indexer\Price\PriceInterface
368-
* @throws \Magento\Catalog\Exception
368+
* @throws \Magento\Framework\Exception\InputException
369369
*/
370370
protected function _getIndexer($productTypeId)
371371
{
372372
$this->getTypeIndexers();
373373
if (!isset($this->_indexers[$productTypeId])) {
374-
throw new \Magento\Catalog\Exception(__('Unsupported product type "%1".', $productTypeId));
374+
throw new \Magento\Framework\Exception\InputException(__('Unsupported product type "%1".', $productTypeId));
375375
}
376376
return $this->_indexers[$productTypeId];
377377
}

app/code/Magento/Catalog/Model/Indexer/Product/Price/Action/Full.php

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Full extends \Magento\Catalog\Model\Indexer\Product\Price\AbstractAction
1616
*
1717
* @param array|int|null $ids
1818
* @return void
19-
* @throws \Magento\Catalog\Exception
19+
* @throws \Magento\Framework\Exception\LocalizedException
2020
*/
2121
public function execute($ids = null)
2222
{
@@ -32,7 +32,7 @@ public function execute($ids = null)
3232
}
3333
$this->_syncData();
3434
} catch (\Exception $e) {
35-
throw new \Magento\Catalog\Exception($e->getMessage(), $e->getCode(), $e);
35+
throw new \Magento\Framework\Exception\LocalizedException(__($e->getMessage()), $e);
3636
}
3737
}
3838
}

app/code/Magento/Catalog/Model/Indexer/Product/Price/Action/Row.php

100644100755
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ class Row extends \Magento\Catalog\Model\Indexer\Product\Price\AbstractAction
1616
*
1717
* @param int|null $id
1818
* @return void
19-
* @throws \Magento\Catalog\Exception
19+
* @throws \Magento\Framework\Exception\InputException
20+
* @throws \Magento\Framework\Exception\LocalizedException
2021
*/
2122
public function execute($id = null)
2223
{
2324
if (!isset($id) || empty($id)) {
24-
throw new \Magento\Catalog\Exception(__('Could not rebuild index for undefined product'));
25+
throw new \Magento\Framework\Exception\InputException(__('Could not rebuild index for undefined product'));
2526
}
2627
try {
2728
$this->_reindexRows([$id]);
2829
} catch (\Exception $e) {
29-
throw new \Magento\Catalog\Exception($e->getMessage(), $e->getCode(), $e);
30+
throw new \Magento\Framework\Exception\LocalizedException(__($e->getMessage()), $e);
3031
}
3132
}
3233
}

app/code/Magento/Catalog/Model/Indexer/Product/Price/Action/Rows.php

100644100755
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ class Rows extends \Magento\Catalog\Model\Indexer\Product\Price\AbstractAction
1616
*
1717
* @param array $ids
1818
* @return void
19-
* @throws \Magento\Catalog\Exception
19+
* @throws \Magento\Framework\Exception\InputException
20+
* @throws \Magento\Framework\Exception\LocalizedException
2021
*/
2122
public function execute($ids)
2223
{
2324
if (empty($ids)) {
24-
throw new \Magento\Catalog\Exception(__('Bad value was supplied.'));
25+
throw new \Magento\Framework\Exception\InputException(__('Bad value was supplied.'));
2526
}
2627
try {
2728
$this->_reindexRows($ids);
2829
} catch (\Exception $e) {
29-
throw new \Magento\Catalog\Exception($e->getMessage(), $e->getCode(), $e);
30+
throw new \Magento\Framework\Exception\LocalizedException(__($e->getMessage()), $e);
3031
}
3132
}
3233
}

0 commit comments

Comments
 (0)