Packages

implicit final class TryOps[A] extends AnyVal

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TryOps
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TryOps(aTry: Try[A])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def collectFail(pf: PartialFunction[Throwable, Throwable]): Try[A]

    The given function is applied if this is a Failure.

    The given function is applied if this is a Failure. The contained throwable is used as cause for the provided one.

    Failure(NotFound).collectFail {
      case NotFound => UrlNotFound
    } // Result: Failure(UrlNotFound(cause = NotFound))
    
    Failure(NotAString).collectFail {
      case NotFound => UrlNotFound
    } // Result: Failure(NotAString)
    
    Success(12).collectFail {
      case NotFound => UrlNotFound
    } // Result: Success(12)
  6. def failAs(t: ⇒ Throwable): Try[A]

    Transforms the inner Throwable to the provided one if this is a failure.

    Transforms the inner Throwable to the provided one if this is a failure. The contained throwable is used as cause for the provided one.

    Failure(NotFound).failAs(UrlNotFound) // Result: Failure(UrlNotFound(cause = NotFound))
    Try(12).failAs(NotFound)              // Result: Success(12)
  7. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  8. def getOrThrow(implicit logger: Logger): A

    Retrieves the value inside this Try or logs/throws the error.

  9. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  10. def mapFail(pf: (Throwable) ⇒ Throwable): Try[A]

    The given function is applied if this is a Failure.

    The given function is applied if this is a Failure. The contained throwable is used as cause for the provided one.

    Failure(NotFound).mapFail(_ => UrlNotFound) // Result: Failure(UrlNotFound(cause = NotFound))
    Success(12).mapFail(_ => UrlNotFound)       // Result: Success(12)
  11. def toString(): String
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped