summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgjoranv <gjoranv@gmail.com>2018-03-02 15:10:48 +0100
committerGitHub <noreply@github.com>2018-03-02 15:10:48 +0100
commit1295c05a17b50a3841ed79a4b4a8d1c96e80f770 (patch)
tree89e3dabee69483c040fc8ec2d27bc3313c72ab3b
parent8ec5743e254b039fe860339fdc4b5ab4aa1f0364 (diff)
parente066c08356d97d73ab3a6af625fc4f00b15bc791 (diff)
Merge pull request #5192 from vespa-engine/hmusum/improve-error-message
Improve exception message
-rw-r--r--container-di/src/main/scala/com/yahoo/container/di/componentgraph/core/ComponentNode.scala7
1 files changed, 3 insertions, 4 deletions
diff --git a/container-di/src/main/scala/com/yahoo/container/di/componentgraph/core/ComponentNode.scala b/container-di/src/main/scala/com/yahoo/container/di/componentgraph/core/ComponentNode.scala
index 0dca08b020a..cc1745d6e35 100644
--- a/container-di/src/main/scala/com/yahoo/container/di/componentgraph/core/ComponentNode.scala
+++ b/container-di/src/main/scala/com/yahoo/container/di/componentgraph/core/ComponentNode.scala
@@ -13,9 +13,6 @@ import com.yahoo.container.di.componentgraph.core.Node.equalEdges
import com.yahoo.container.di.{ConfigKeyT, JavaAnnotation, createKey, makeClassCovariant, preserveStackTrace, removeStackTrace}
import com.yahoo.vespa.config.ConfigKey
-import scala.concurrent.ExecutionContext.Implicits.global
-import scala.concurrent.duration._
-import scala.concurrent.{Await, Future, TimeoutException}
import scala.language.postfixOps
/**
@@ -116,7 +113,9 @@ class ComponentNode(componentId: ComponentId,
private def initId(component: AnyRef) = {
def checkAndSetId(c: AbstractComponent) {
if (c.hasInitializedId && c.getId != componentId )
- throw new IllegalStateException("Component with id '" + componentId + "' has set a bogus component id: '" + c.getId + "'")
+ throw new IllegalStateException(
+ s"Component with id '$componentId' is trying to set its component id explicitly: '${c.getId}'. " +
+ "This is not allowed, so please remove any call to super() in your component's constructor.")
c.initId(componentId)
}