diff options
author | gjoranv <gv@yahoo-inc.com> | 2017-05-18 19:18:22 +0200 |
---|---|---|
committer | gjoranv <gv@yahoo-inc.com> | 2017-05-18 19:18:22 +0200 |
commit | 8faad03bdf41f04dee78904d71e4fe9a74d2679c (patch) | |
tree | d128fd88bf4aa4a85558e63564a46413cfd8bc50 /container-di | |
parent | d3d912511b7f3a2599a0008c09b26e91773bc4f6 (diff) |
Extract values for duplicated strings.
Diffstat (limited to 'container-di')
-rw-r--r-- | container-di/src/main/scala/com/yahoo/container/di/Container.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/container-di/src/main/scala/com/yahoo/container/di/Container.scala b/container-di/src/main/scala/com/yahoo/container/di/Container.scala index a710e588f7f..3868ad0f970 100644 --- a/container-di/src/main/scala/com/yahoo/container/di/Container.scala +++ b/container-di/src/main/scala/com/yahoo/container/di/Container.scala @@ -71,18 +71,21 @@ class Container( val maxWaitToExit = 180L def newGraphErrorMessage(generation: Long, cause: Throwable): String = { + val failedFirstMessage = "Failed to set up first component graph" + val failedNewMessage = "Failed to set up new component graph" + val constructMessage = "due to error when constructing one of the components" val exitMessage = s"Exiting within $maxWaitToExit seconds." val retainMessage = "Retaining previous component generation." generation match { case 0 => cause match { - case _: ComponentConstructorException => s"Failed to set up first component graph due to error when constructing one of the components. $exitMessage" - case _ => s"Failed to set up first component graph. $exitMessage" + case _: ComponentConstructorException => s"$failedFirstMessage $constructMessage. $exitMessage" + case _ => s"$failedFirstMessage. $exitMessage" } case _ => cause match { - case _: ComponentConstructorException => s"Failed to set up new component graph due to error when constructing one of the components. $retainMessage" - case _ => s"Failed to set up new component graph. $retainMessage" + case _: ComponentConstructorException => s"$failedNewMessage $constructMessage. $retainMessage" + case _ => s"$failedNewMessage. $retainMessage" } } } |