Skip to content
This repository has been archived by the owner on May 8, 2021. It is now read-only.

Commit

Permalink
add explicit error message for sources missing name
Browse files Browse the repository at this point in the history
  • Loading branch information
wlam committed Nov 27, 2014
1 parent 1493281 commit 9cb9de6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/scala/com/walmartlabs/mupd8/AppStaticInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ class AppStaticInfo(val configDir: Option[String], val appConfig: Option[String]
x => x.asInstanceOf[java.util.List[org.json.simple.JSONObject]]
}.getOrElse(new java.util.ArrayList[org.json.simple.JSONObject]())

val namelessSources = sources.asScala.filter { source => (source.get("name") == null) }.length
if (namelessSources > 0) {
error(namelessSources+" source(s) detected without required unique name attribute; aborting.")
System.exit(-1)
}

val messageServerHostFromConfig: String = Option(config.getScopedValue(Array("mupd8", "messageserver", "host"))) match {
case None => error("Message server host setting is wrong, exit..."); System.exit(-1); null
case Some(str) => str.asInstanceOf[String]
Expand Down

0 comments on commit 9cb9de6

Please sign in to comment.