Scala Library
|
|
scala/util/control/Exception.scala
]
class
Try[+T](body : => T, val
catcher : Catch[T])
extends
AnyRefMethod Summary | |
def
|
andFinally
(fin : => Unit) : Try[T]
Create a new Try with the supplied code appended to the existing Finally.
|
def
|
apply
: T
Execute "body" using catch/finally logic "catcher"
|
def
|
apply [U >: T](other : => U) : U |
def
|
either
: Either[java.lang.Throwable, T]
As apply, but map caught exceptions to Left(ex) and success to Right(x)
|
def
|
either [U >: T](other : => U) : Either[java.lang.Throwable, U] |
def
|
opt
: Option[T]
As apply, but map caught exceptions to None and success to Some(T)
|
def
|
opt [U >: T](other : => U) : Option[U] |
def
|
or
[U >: T](pf : PartialFunction[U]) : Try[U]
Create a new Try with the supplied logic appended to the existing Catch logic.
|
override def
|
toString
: java.lang.String
Returns a string representation of the object.
|
def
|
tryInstead
[U >: T](other : => U) : Try[U]
Create a new Try with the supplied body replacing the current body
|
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
def
apply : T
def
either : Either[java.lang.Throwable, T]
def
either[U >: T](other : => U) : Either[java.lang.Throwable, U]
def
or[U >: T](pf : PartialFunction[U]) : Try[U]
override
def
toString : java.lang.String
The default representation is platform dependent.
Scala Library
|
|