ErrorFilter
org.apache.pekko.testkit.ErrorFilter
final case class ErrorFilter(throwable: Class[_], source: Option[String], message: Either[String, Regex], complete: Boolean)(occurrences: Int) extends EventFilter
Filter which matches Error events, if they satisfy the given criteria:
-
throwableapplies an upper bound on the type of exception contained in the Error event -
source, if given, applies a filter on the event’s origin -
messageapplies a filter on the event’s message (either with String.startsWith or Regex.findFirstIn().isDefined); if the message itself does not match, the match is retried with the contained Exception’s message; if both arenull, the filter always matches if at the same time the Exception’s stack trace is empty (this catches JVM-omitted “fast-throw” exceptions)
If you want to match all Error events, the most efficient is to use Left("").
Attributes
- Source
- TestEventListener.scala
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass EventFilterclass Objecttrait Matchableclass Any
Members list
In this article