object Exceptional extends Serializable
Companion object to class Exceptional
that provides a factory method and an extractor that enables
patterns that match both Failed
and Canceled
outcomes and
extracts the contained exception and a factory method.
- Source
- Outcome.scala
- Alphabetic
- By Inheritance
- Exceptional
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(e: Throwable): Exceptional
Creates an
Exceptional
instance given the passedThrowable
.Creates an
Exceptional
instance given the passedThrowable
.If the passed
Throwable
is an instance ofTestCanceledException
, this method will returnCanceled
containing thatTestCanceledException
. Otherwise, it returns aFailed
containing theThrowable
.For example, trait
SeveredStackTraces
uses this factory method to sever the stack trace of the exception contained in either aFailed
andCanceled
like this:abstract override def withFixture(test: NoArgTest): Outcome = { super.withFixture(test) match { case Exceptional(e: StackDepth) => Exceptional(e.severedAtStackDepth) case o => o } }
- returns
a
Failed
orCanceled
containing the passed exception.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unapply(res: Outcome): Option[Throwable]
Extractor enabling patterns that match both
Failed
and Canceled outcomes, extracting the contained exception.Extractor enabling patterns that match both
Failed
and Canceled outcomes, extracting the contained exception.For example, trait
SeveredStackTraces
uses this extractor to sever the stack trace of the exception contained in either aFailed
andCanceled
like this:abstract override def withFixture(test: NoArgTest): Outcome = { super.withFixture(test) match { case Exceptional(e: StackDepth) => Exceptional(e.severedAtStackDepth) case o => o } }
- res
the
Outcome
to extract the throwable from.- returns
a
Some
wrapping the contained throwable ifres
is an instance of eitherFailed
orCanceled
, elseNone
.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()