vertx / io.vertx.rxjava.core / Future / otherwise

# otherwise

`open fun otherwise(mapper: Function<Throwable, T>): Future<T>`

Apply a `mapper` function on this future.

When this future fails, the `mapper` will be called with the completed value and this mapper returns a value. This value will complete the future returned by this method call.

If the `mapper` throws an exception, the returned future will be failed with this exception.

When this future succeeds, the result will be propagated to the returned future and the `mapper` will not be called.

### Parameters

`mapper` - the mapper function

Return
the mapped future

`open fun otherwise(value: T): Future<T>`

Map the failure of a future to a specific `value`.

When this future fails, this `value` will complete the future returned by this method call.

When this future succeeds, the result will be propagated to the returned future.

### Parameters

`value` - the value that eventually completes the mapped future

Return
the mapped future