8000 Manage the new ORecordDuplicatedException exception raised when an As… · githubcs/baasbox@0cc00d9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0cc00d9

Browse files
committed
Manage the new ORecordDuplicatedException exception raised when an Asset already exists
1 parent e275ae7 commit 0cc00d9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/com/baasbox/controllers/Asset.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import com.orientechnologies.orient.core.index.OIndexException;
6161
import com.orientechnologies.orient.core.record.impl.ODocument;
6262
import com.orientechnologies.orient.core.record.impl.ORecordBytes;
63+
import com.orientechnologies.orient.core.storage.ORecordDuplicatedException;
6364

6465
public class Asset extends Controller{
6566
private static String prepareResponseToJson(ODocument doc){
@@ -310,6 +311,8 @@ public static Result post() throws Throwable{
310311
try{
311312
ODocument doc=AssetService.create(assetName,metaJson);
312313
ret=prepareResponseToJson(doc);
314+
}catch (ORecordDuplicatedException e){
315+
return badRequest("An asset with the same name already exists");
313316
}catch (OIndexException e){
314317
return badRequest("An asset with the same name already exists");
315318
}catch (OSerializationException e){

0 commit comments

Comments
 (0)
0