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
- Protected
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
Exceptionalinstance given the passedThrowable.Creates an
Exceptionalinstance given the passedThrowable.If the passed
Throwableis an instance ofTestCanceledException, this method will returnCanceledcontaining thatTestCanceledException. Otherwise, it returns aFailedcontaining theThrowable.For example, trait
SeveredStackTracesuses this factory method to sever the stack trace of the exception contained in either aFailedandCanceledlike this:abstract override def withFixture(test: NoArgTest): Outcome = { super.withFixture(test) match { case Exceptional(e: StackDepth) => Exceptional(e.severedAtStackDepth) case o => o } }
- returns
a
FailedorCanceledcontaining the passed exception.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[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[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
Failedand Canceled outcomes, extracting the contained exception.Extractor enabling patterns that match both
Failedand Canceled outcomes, extracting the contained exception.For example, trait
SeveredStackTracesuses this extractor to sever the stack trace of the exception contained in either aFailedandCanceledlike this:abstract override def withFixture(test: NoArgTest): Outcome = { super.withFixture(test) match { case Exceptional(e: StackDepth) => Exceptional(e.severedAtStackDepth) case o => o } }
- res
the
Outcometo extract the throwable from.- returns
a
Somewrapping the contained throwable ifresis an instance of eitherFailedorCanceled, 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()