forked from D-Net/dnet-hadoop
raised runtimeexception on record without title or url
This commit is contained in:
parent
7fc5b97871
commit
d0df02062c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue