scala.util.control.Exception

class Try

[source: scala/util/control/Exception.scala]

class Try[+T](body : => T, val catcher : Catch[T])
extends AnyRef
A container class for Try logic
Method Summary
def andFinally (fin : => Unit) : Try[T]
Create a new Try with the supplied code appended to the existing Finally.
def apply [U >: T](other : => U) : U
def apply : T
Execute "body" using catch/finally logic "catcher"
def either [U >: T](other : => U) : Either[java.lang.Throwable, U]
def either : Either[java.lang.Throwable, T]
As apply, but map caught exceptions to Left(ex) and success to Right(x)
def opt [U >: T](other : => U) : Option[U]
def opt : Option[T]
As apply, but map caught exceptions to None and success to Some(T)
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
Execute "body" using catch/finally logic "catcher"

def apply[U >: T](other : => U) : 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 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 tryInstead[U >: T](other : => U) : Try[U]
Create a new Try with the supplied body replacing the current body

def or[U >: T](pf : PartialFunction[U]) : Try[U]
Create a new Try with the supplied logic appended to the existing Catch logic.

def andFinally(fin : => Unit) : Try[T]
Create a new Try with the supplied code appended to the existing Finally.

override def toString : java.lang.String
Returns a string representation of the object.

The default representation is platform dependent.

Returns
a string representation of the object.