Creates a new future that will handle any matching throwable that this future might contain.
Creates a new future that will handle any matching throwable that this future might contain. If there is no match, or if this future contains a valid result then the new future will contain the same.
Creates a new future that will handle any matching throwable that this future might contain by assigning it a value of another future.
Creates a new future that will handle any matching throwable that this future might contain by assigning it a value of another future.
If there is no match, or if this future contains a valid result then the new future will contain the same result.
Creates a new future by applying the 's' function to the successful result of this future, or the 'f' function to the failed result.
Creates a new future by applying the 's' function to the successful result of this future, or the 'f' function to the failed result. If there is any non-fatal exception thrown when 's' or 'f' is applied, that exception will be propagated to the resulting future.
function that transforms a successful result of the receiver into a successful result of the returned future
function that transforms a failure of the receiver into a failure of the returned future
a future that will be completed with the transformed value
Helper method to guard against RPC failures and the like.
Helper method to guard against RPC failures and the like. Variation of withEitherFallback method where a default value is returned in cases where there an exception is thrown.
If no errorCallback is specified the exception is logged as an error.
Helper method to guard against RPC failures and the like, converts a 'regular' Future to a Future of Option.
Helper method to guard against RPC failures and the like, converts a 'regular' Future to a Future of Option. Variation of withTryFallback method where None represents an error (exception was thrown) case and Some[T] represents an Ok case.
Optional errorCallback parameter allows caller to inject e.g. custom error logging, like
class Foo extends Loggable { f.withOptionFallback(error(_)) }
If no errorCallback is specified the exception is logged as an error.
Helper method to guard against RPC failures and the like, converts a 'regular' Future to a Future of Try with Failure representing cases where an exception was caught and Success[T] representing desired results.
Helper method to guard against RPC failures and the like, converts a 'regular' Future to a Future of Either with Left[Throwable] representing cases where an exception was caught and Right[T] representing desired results.
Helper method to guard against RPC failures and the like, converts a 'regular' Future to a Future of Either with Left[Throwable] representing cases where an exception was caught and Right[T] representing desired results.
(Since version 0.1.0) Use withTryFallback