File tree 1 file changed +3
-0
lines changed
app/com/baasbox/controllers 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 60
60
import com .orientechnologies .orient .core .index .OIndexException ;
61
61
import com .orientechnologies .orient .core .record .impl .ODocument ;
62
62
import com .orientechnologies .orient .core .record .impl .ORecordBytes ;
63
+ import com .orientechnologies .orient .core .storage .ORecordDuplicatedException ;
63
64
64
65
public class Asset extends Controller {
65
66
private static String prepareResponseToJson (ODocument doc ){
@@ -310,6 +311,8 @@ public static Result post() throws Throwable{
310
311
try {
311
312
ODocument doc =AssetService .create (assetName ,metaJson );
312
313
ret =prepareResponseToJson (doc );
314
+ }catch (ORecordDuplicatedException e ){
315
+ return badRequest ("An asset with the same name already exists" );
313
316
}catch (OIndexException e ){
314
317
return badRequest ("An asset with the same name already exists" );
315
318
}catch (OSerializationException e ){
You can’t perform that action at this time.
0 commit comments