Scala Library
|
|
scala/util/control/Exception.scala
]
class
Catch[+T](val
pf : PartialFunction[T], val
fin : Option[Finally])
extends
DescribedAdditional Constructor Summary | |
def
|
this (pf : PartialFunction[T]) : Catch[T] |
Value Summary | |
protected val
|
name : java.lang.String |
Method Summary | |
def
|
andFinally (body : => Unit) : Catch[T] |
def
|
apply
[U >: T](body : => U) : U
Apply this catch logic to the supplied body.
|
def
|
either
[U >: T](body : => U) : Either[java.lang.Throwable, U]
Apply this catch logic to the supplied body, mapping the result
into Either[Throwable, T] - Left(exception) if an exception was caught,
Right(T) otherwise.
|
def
|
opt
[U >: T](body : => U) : Option[U]
Apply this catch logic to the supplied body, mapping the result
into Option[T] - None if any exception was caught, Some(T) otherwise.
|
def
|
or [U >: T](other : Catch[U]) : Catch[U] |
def
|
or
[U >: T](pf2 : PartialFunction[U]) : Catch[U]
Create a new Catch with additional exception handling logic.
|
def
|
toEither : Catch[Either[java.lang.Throwable, T]] |
def
|
toOption
: Catch[Option[T]]
Convenience methods.
|
def
|
withApply
[U](f : (java.lang.Throwable) => U) : Catch[U]
Create a new Catch with the same isDefinedAt logic as this one,
but with the supplied apply method replacing the current one.
|
Methods inherited from Described | |
desc, withDesc, toString |
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Additional Constructor Details |
Value Details |
Method Details |
def
or[U >: T](pf2 : PartialFunction[U]) : Catch[U]
def
either[U >: T](body : => U) : Either[java.lang.Throwable, U]
def
withApply[U](f : (java.lang.Throwable) => U) : Catch[U]
def
toEither : Catch[Either[java.lang.Throwable, T]]
Scala Library
|
|