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()
129
129
{
130
130
$ assetstore ->setName ($ assetstoreName );
131
131
$ 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
+ }
133
141
echo JsonComponent::encode (array (true , $ this ->t ('Changes saved ' )));
134
142
return ;
135
143
}
@@ -160,8 +168,16 @@ function addAction()
160
168
$ assetstoreDao ->setName ($ form ->name ->getValue ());
161
169
$ assetstoreDao ->setPath ($ form ->basedirectory ->getValue ());
162
170
$ 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
+
165
181
echo json_encode (array ('msg ' => 'The assetstore has been added. ' ,
166
182
'assetstore_id ' => $ assetstoreDao ->getAssetstoreId (),
167
183
'assetstore_name ' => $ assetstoreDao ->getName (),
You can’t perform that action at this time.
0 commit comments