open fun <E : Throwable!> getOrElseThrow(): T
Returns Success value or in case of Failure throws exception that is stored in the Failure.
E - exception thrown if the method is invoked on Failure.
Return
T: value stored in the Success
open fun <E : Throwable!> getOrElseThrow(@NonNull provider: (in Throwable!) -> E): T
Returns Success value or in case of Failure throws exception that can be built by the given function from the throwable stored in the Failure.
provider - (in Throwable!) -> E: function for converting Exception stored in Failure into the desired exception type.
- type of the exception that should be thrown if Failure.
E - exception thrown if the method is invoked on Failure