make error message more clear when logger initialization times out
This commit is contained in:
parent
e500548494
commit
e19b258ce0
1 changed files with 2 additions and 1 deletions
|
|
@ -153,11 +153,12 @@ trait LoggingBus extends ActorEventBus {
|
|||
private def addLogger(system: ActorSystemImpl, clazz: Class[_ <: Actor], level: LogLevel, logName: String): ActorRef = {
|
||||
val name = "log" + Extension(system).id() + "-" + simpleName(clazz)
|
||||
val actor = system.systemActorOf(Props(clazz), name)
|
||||
implicit val timeout = Timeout(3 seconds)
|
||||
implicit val timeout = Timeout(5 seconds)
|
||||
import akka.pattern.ask
|
||||
val response = try Await.result(actor ? InitializeLogger(this), timeout.duration) catch {
|
||||
case _: TimeoutException ⇒
|
||||
publish(Warning(logName, this.getClass, "Logger " + name + " did not respond within " + timeout + " to InitializeLogger(bus)"))
|
||||
"[TIMEOUT]"
|
||||
}
|
||||
if (response != LoggerInitialized)
|
||||
throw new LoggerInitializationException("Logger " + name + " did not respond with LoggerInitialized, sent instead " + response)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue