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
@@ -139,6 +140,8 @@ public function save(\Magento\Sales\Api\Data\CreditmemoInterface $entity)
139
140
try {
140
141
$ this ->metadata ->getMapper ()->save ($ entity );
141
142
$ this ->registry [$ entity ->getEntityId ()] = $ entity ;
143
+ } catch (LocalizedException $ e ) {
144
+ throw new CouldNotSaveException (__ ($ e ->getMessage ()), $ e );
142
145
} catch (\Exception $ e ) {
143
146
throw new CouldNotSaveException (__ ("The credit memo couldn't be saved. " ), $ e );
144
147
}
You can’t perform that action at this time.
0 commit comments