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.
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 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 Option.
Helper method to guard against RPC failures and the like, converts a 'regular' Future to a Future of Option. Variation of withEitherFallback 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.