This repository was archived by the owner on Sep 10, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,15 @@ function editAction()
129129 {
130130 $ assetstore ->setName ($ assetstoreName );
131131 $ assetstore ->setPath ($ assetstorePath );
132- $ this ->Assetstore ->save ($ assetstore );
132+ try
133+ {
134+ $ this ->Assetstore ->save ($ assetstore );
135+ }
136+ catch (Zend_Exception $ ze )
137+ {
138+ echo JsonComponent::encode (array (false , $ ze ->getMessage ()));
139+ return ;
140+ }
133141 echo JsonComponent::encode (array (true , $ this ->t ('Changes saved ' )));
134142 return ;
135143 }
@@ -160,8 +168,16 @@ function addAction()
160168 $ assetstoreDao ->setName ($ form ->name ->getValue ());
161169 $ assetstoreDao ->setPath ($ form ->basedirectory ->getValue ());
162170 $ assetstoreDao ->setType ($ form ->assetstoretype ->getValue ());
163- $ this ->Assetstore ->save ($ assetstoreDao );
164-
171+ try
172+ {
173+ $ this ->Assetstore ->save ($ assetstoreDao );
174+ }
175+ catch (Zend_Exception $ ze )
176+ {
177+ echo json_encode (array ('error ' => $ ze ->getMessage ()));
178+ return false ;
179+ }
180+
165181 echo json_encode (array ('msg ' => 'The assetstore has been added. ' ,
166182 'assetstore_id ' => $ assetstoreDao ->getAssetstoreId (),
167183 'assetstore_name ' => $ assetstoreDao ->getName (),
You can’t perform that action at this time.
0 commit comments