actor: remove stack trace from AskTimeoutException (#29376)

The exception will be instantiated from the scheduler thread so it does
not contain any more helpful information.
This commit is contained in:
Johannes Rudolph 2020-07-13 13:37:28 +02:00 committed by GitHub
parent 96c887b134
commit 54d79df07d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,12 +20,14 @@ import akka.util.ByteString
import akka.util.{ Timeout, Unsafe }
import akka.util.unused
import scala.util.control.NoStackTrace
/**
* This is what is used to complete a Future that is returned from an ask/? call,
* when it times out. A typical reason for `AskTimeoutException` is that the recipient
* actor didn't send a reply.
*/
class AskTimeoutException(message: String, cause: Throwable) extends TimeoutException(message) {
class AskTimeoutException(message: String, cause: Throwable) extends TimeoutException(message) with NoStackTrace {
def this(message: String) = this(message, null: Throwable)
override def getCause(): Throwable = cause
}