Exceptions

org.specs2.control.Exceptions
See theExceptions companion trait
object Exceptions extends Exceptions

Attributes

Companion
trait
Graph
Supertypes
trait Exceptions
class Object
trait Matchable
class Any
Self type
Exceptions.type

Members list

Value members

Inherited methods

def catchAll[T, S](a: => T)(f: Throwable => S): Either[S, T]

try to evaluate an expression, returning Either

try to evaluate an expression, returning Either

If the expression throws any Throwable a function f is used to return the left value of the Either returned value.

Attributes

Inherited from:
Exceptions
def catchAllOr[T](a: => T)(f: Throwable => T): T

try to evaluate an expression, returning a value T

try to evaluate an expression, returning a value T

If the expression throws a Throwable a function f is used to return a value of the expected type.

Attributes

Inherited from:
Exceptions
def catchAllOrElse[T](a: => T)(ko: => T): T

try to evaluate an expression, returning a value T

try to evaluate an expression, returning a value T

If the expression throws a Throwable, then return a default value

Attributes

Inherited from:
Exceptions
def catchAll_Either[T, S](a: => T)(f: Throwable => S): Either[S, T]

try to evaluate an expression, returning Either

try to evaluate an expression, returning Either

If the expression throws an Exception a function f is used to return the left value of the Either returned value.

Attributes

Inherited from:
Exceptions
def tryCollect[T](a: => T)(partialFunction: PartialFunction[T, Boolean]): Boolean

try to apply a partial function to a value

try to apply a partial function to a value

Attributes

Inherited from:
Exceptions
def tryCollectOr[T, S](a: => T, or: S)(partialFunction: PartialFunction[T, S]): S

try to apply a partial function to a value, with a default value if something goes wrong

try to apply a partial function to a value, with a default value if something goes wrong

Attributes

Inherited from:
Exceptions
def tryMap[T, S](a: => T)(ok: S)(ko: S): S

try to evaluate an expression and return ok if nothing fails. return ko otherwise

try to evaluate an expression and return ok if nothing fails. return ko otherwise

Attributes

Inherited from:
Exceptions
def tryOk[T](a: => T): Boolean

try to evaluate an expression and return true if nothing fails. return false otherwise

try to evaluate an expression and return true if nothing fails. return false otherwise

Attributes

Inherited from:
Exceptions
def tryOr[T](a: => T)(f: Throwable => T): T

try to evaluate an expression, returning a value T

try to evaluate an expression, returning a value T

If the expression throws an Exception a function f is used to return a value of the expected type.

Attributes

Inherited from:
Exceptions
def tryOrElse[T](a: => T)(ko: T): T

try to evaluate an expression and return it if nothing fails. return ko otherwise

try to evaluate an expression and return it if nothing fails. return ko otherwise

Attributes

Inherited from:
Exceptions
def tryOrNone[T](a: => T): Option[T]

try to evaluate an expression and return it in an Option if nothing fails. return None otherwise

try to evaluate an expression and return it in an Option if nothing fails. return None otherwise

Attributes

Inherited from:
Exceptions
def try_Either[T, S](a: => T)(f: Throwable => S): Either[S, T]

try to evaluate an expression, returning Either

try to evaluate an expression, returning Either

If the expression throws an Exception a function f is used to return the left value of the Either returned value.

Attributes

Inherited from:
Exceptions
def trye[T, S](a: => T)(f: Throwable => S): Either[S, T]

try to evaluate an expression, returning Either

try to evaluate an expression, returning Either

If the expression throws an Exception a function f is used to return the left value of the Either returned value.

Attributes

Inherited from:
Exceptions
def tryo[T](a: => T): Option[T]

try to evaluate an expression, returning an Option

try to evaluate an expression, returning an Option

The 'tryo' name comes from the lift project: http://liftweb.net

Attributes

Returns

None if there is an exception, or Some(value)

Inherited from:
Exceptions