From 54d79df07db064443f18e407761d9a605118f7e4 Mon Sep 17 00:00:00 2001 From: Johannes Rudolph Date: Mon, 13 Jul 2020 13:37:28 +0200 Subject: [PATCH] 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. --- akka-actor/src/main/scala/akka/pattern/AskSupport.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/akka-actor/src/main/scala/akka/pattern/AskSupport.scala b/akka-actor/src/main/scala/akka/pattern/AskSupport.scala index b5e82faf08..f69ae82e9e 100644 --- a/akka-actor/src/main/scala/akka/pattern/AskSupport.scala +++ b/akka-actor/src/main/scala/akka/pattern/AskSupport.scala @@ -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 }