This is an old question, but I leave my way to deal with it.
If an exception is what I do not expect, I usually relate to it above the actor’s leader:
override val supervisorStrategy =
OneForOneStrategy(maxNrOfRetries = 10, withinTimeRange = 1 minute) {
case _: ArithmeticException => {
log.error("\n# ArithmeticException -> Resume\n")
Resume
}
}
}
For other types of errors, I tend to respond to the error and solve it after:
case class IError(code:Int, msg:Option[String] = None)
sender ! IError(401, msg= Some("Unauthorized"))
source
share