Skip to content

Commit b842204

Browse files
author
Mariana Lashch
committed
Merge branch 'MAGETWO-92847' into mpi-PR-0907
2 parents 422d408 + cd74dbb commit b842204

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
@@ -137,6 +138,8 @@ public function save(\Magento\Sales\Api\Data\CreditmemoInterface $entity)
137138
try {
138139
$this->metadata->getMapper()->save($entity);
139140
$this->registry[$entity->getEntityId()] = $entity;
141+
} catch (LocalizedException $e) {
142+
throw new CouldNotSaveException(__($e->getMessage()), $e);
140143
} catch (\Exception $e) {
141144
throw new CouldNotSaveException(__('Could not save credit memo'), $e);
142145
}

0 commit comments

Comments
 (0)