raised runtimeexception on record without title or url

This commit is contained in:
Enrico Ottonello 2022-04-06 13:19:58 +02:00
parent 7fc5b97871
commit d0df02062c
1 changed files with 2 additions and 2 deletions

View File

@ -101,7 +101,7 @@ object BioschemaToOAFTransformation {
val titles: List[TitleType] = (json \\ "titles").extractOrElse[List[TitleType]](List())
if (titles.isEmpty) {
return List()
throw new RuntimeException("Title not found")
}
result.setTitle(
titles
@ -192,7 +192,7 @@ object BioschemaToOAFTransformation {
.asJava
)
if (instance.getUrl.isEmpty) {
return List()
throw new RuntimeException("Url not found")
}
instance.setCollectedfrom(collectedFromMap(datasourceKey))
instance.setPid(result.getPid)