Skip to content

Commit a06b6d4

Browse files
author
Mastiuhin Olexandr
committed
Merge branch 'MAGETWO-93172' into 2.3-develop-pr5
2 parents 7bf1bfe + 38cd10c commit a06b6d4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

app/code/Magento/Sales/Model/Order/CreditmemoRepository.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
namespace Magento\Sales\Model\Order;
88

99
use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface;
10-
use Magento\Sales\Model\ResourceModel\Metadata;
11-
use Magento\Sales\Api\Data\CreditmemoSearchResultInterfaceFactory as SearchResultFactory;
12-
use Magento\Framework\Exception\NoSuchEntityException;
13-
use Magento\Framework\Exception\InputException;
1410
use Magento\Framework\Exception\CouldNotDeleteException;
1511
use Magento\Framework\Exception\CouldNotSaveException;
12+
use Magento\Framework\Exception\InputException;
13+
use Magento\Framework\Exception\LocalizedException;
14+
use Magento\Framework\Exception\NoSuchEntityException;
15+
use Magento\Sales\Api\Data\CreditmemoSearchResultInterfaceFactory as SearchResultFactory;
16+
use Magento\Sales\Model\ResourceModel\Metadata;
1617

1718
/**
1819
* Repository class for @see \Magento\Sales\Api\Data\CreditmemoInterface
@@ -139,6 +140,8 @@ public function save(\Magento\Sales\Api\Data\CreditmemoInterface $entity)
139140
try {
140141
$this->metadata->getMapper()->save($entity);
141142
$this->registry[$entity->getEntityId()] = $entity;
143+
} catch (LocalizedException $e) {
144+
throw new CouldNotSaveException(__($e->getMessage()), $e);
142145
} catch (\Exception $e) {
143146
throw new CouldNotSaveException(__("The credit memo couldn't be saved."), $e);
144147
}

0 commit comments

Comments
 (0)