abstract classControlThrowable extends Throwable with control.ControlThrowable
A parent class for throwable objects intended for flow control.
Instances of ControlThrowable should not normally be caught.
As a convenience, NonFatal does not match ControlThrowable.
import scala.util.control.{Breaks, NonFatal}, Breaks.{break, breakable}
breakable {
for (v <- values) {
try {
if (p(v)) break
else ???
} catch {
case NonFatal(t) => log(t) // can't catch a break
}
}
}
Suppression is disabled, because flow control should not suppress
an exceptional condition. Stack traces are also disabled, allowing
instances of ControlThrowable to be safely reused.
Instances of ControlThrowable should not normally have a cause.
Legacy subclasses may set a cause using initCause.
Note
this compat class exists so that instances of ControlThrowable
can be created using the same API and with the same suppression
and stack trace writability semantics across versions.
Linear Supertypes
control.ControlThrowable, NoStackTrace, java.lang.Throwable, java.io.Serializable, AnyRef, Any
Ordering
Alphabetic
By Inheritance
Inherited
ControlThrowable
ControlThrowable
NoStackTrace
Throwable
Serializable
AnyRef
Any
Hide All
Show All
Visibility
Public
All
Instance Constructors
newControlThrowable()
newControlThrowable(message: String)
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
final defaddSuppressed(arg0: java.lang.Throwable): Unit
A parent class for throwable objects intended for flow control.
Instances of
ControlThrowable
should not normally be caught.As a convenience,
NonFatal
does not matchControlThrowable
.Suppression is disabled, because flow control should not suppress an exceptional condition. Stack traces are also disabled, allowing instances of
ControlThrowable
to be safely reused.Instances of
ControlThrowable
should not normally have a cause. Legacy subclasses may set a cause usinginitCause
.this compat class exists so that instances of
ControlThrowable
can be created using the same API and with the same suppression and stack trace writability semantics across versions.