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 7
7
namespace Magento \Sales \Model \Order ;
8
8
9
9
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 ;
14
10
use Magento \Framework \Exception \CouldNotDeleteException ;
15
11
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 ;
16
17
17
18
/**
18
19
* Repository class for @see \Magento\Sales\Api\Data\CreditmemoInterface
@@ -137,6 +138,8 @@ public function save(\Magento\Sales\Api\Data\CreditmemoInterface $entity)
137
138
try {
138
139
$ this ->metadata ->getMapper ()->save ($ entity );
139
140
$ this ->registry [$ entity ->getEntityId ()] = $ entity ;
141
+ } catch (LocalizedException $ e ) {
142
+ throw new CouldNotSaveException (__ ($ e ->getMessage ()), $ e );
140
143
} catch (\Exception $ e ) {
141
144
throw new CouldNotSaveException (__ ('Could not save credit memo ' ), $ e );
142
145
}
You can’t perform that action at this time.
0 commit comments