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())
|
val titles: List[TitleType] = (json \\ "titles").extractOrElse[List[TitleType]](List())
|
||||||
if (titles.isEmpty) {
|
if (titles.isEmpty) {
|
||||||
return List()
|
throw new RuntimeException("Title not found")
|
||||||
}
|
}
|
||||||
result.setTitle(
|
result.setTitle(
|
||||||
titles
|
titles
|
||||||
|
@ -192,7 +192,7 @@ object BioschemaToOAFTransformation {
|
||||||
.asJava
|
.asJava
|
||||||
)
|
)
|
||||||
if (instance.getUrl.isEmpty) {
|
if (instance.getUrl.isEmpty) {
|
||||||
return List()
|
throw new RuntimeException("Url not found")
|
||||||
}
|
}
|
||||||
instance.setCollectedfrom(collectedFromMap(datasourceKey))
|
instance.setCollectedfrom(collectedFromMap(datasourceKey))
|
||||||
instance.setPid(result.getPid)
|
instance.setPid(result.getPid)
|
||||||
|
|
Loading…
Reference in New Issue