Collect the results from the given Trys into a new Try.
Collect the results from the given Trys into a new Try. The result will be a Throw if any of the argument Trys are Throws. The first Throw in the Seq is the one which is surfaced.
Build a Try from a scala.util.Try.
Build a Try from a scala.util.Try. This does nothing more than pattern match and translate Success and Failure to Return and Throw respectively.
Convert an scala.Option to a Try.
Convert an scala.Option to a Try.
For users from scala, there's also the implicit class OrThrow which allows
import Try._ Option(null).orThrow { new Exception("boom!") }
the Option to convert to a Try
a function that returns the Throwable that should be returned if the option is None
Like Try.apply but allows the caller to specify a handler for fatal errors.
The Try type represents a computation that may either result in an exception or return a success value. It is analogous to the Either type but encodes common idioms for handling exceptional cases (such as rescue/ensure which is analogous to try/finally).