File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
app/code/Magento/Sales/Model/Order Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 77namespace Magento \Sales \Model \Order ;
88
99use 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 ;
1410use Magento \Framework \Exception \CouldNotDeleteException ;
1511use 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 }
You can’t perform that action at this time.
0 commit comments