Fixed thrown exception in case the type does not exists to return a 404

Not Found HTTP error to client
This commit is contained in:
Luca Frosini 2020-02-05 16:16:21 +01:00
parent 8413b94a86
commit 3bbcccca79
1 changed files with 3 additions and 0 deletions

View File

@ -383,6 +383,9 @@ public class SchemaManagementImpl implements SchemaManagement {
OMetadata oMetadata = oDatabaseDocument.getMetadata(); OMetadata oMetadata = oDatabaseDocument.getMetadata();
OSchema oSchema = oMetadata.getSchema(); OSchema oSchema = oMetadata.getSchema();
OClass baseOClass = oSchema.getClass(typeName); OClass baseOClass = oSchema.getClass(typeName);
if(baseOClass == null) {
throw new SchemaNotFoundException(typeName + " does not Exists");
}
List<Type> typeDefinitions = new ArrayList<>(); List<Type> typeDefinitions = new ArrayList<>();
typeDefinitions.add(getType(baseOClass)); typeDefinitions.add(getType(baseOClass));