React\Promise\Promise::otherwise PHP Method

otherwise() public method

public otherwise ( callable $onRejected )
$onRejected callable
    public function otherwise(callable $onRejected)
    {
        return $this->then(null, function ($reason) use($onRejected) {
            if (!_checkTypehint($onRejected, $reason)) {
                return new RejectedPromise($reason);
            }
            return $onRejected($reason);
        });
    }