You are here

public function Coroutine::otherwise in Auth0 Single Sign On 8.2

Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.

Parameters

callable $onRejected Invoked when the promise is rejected.:

Return value

PromiseInterface

Overrides PromiseInterface::otherwise

File

vendor/guzzlehttp/promises/src/Coroutine.php, line 78

Class

Coroutine
Creates a promise that is resolved using a generator that yields values or promises (somewhat similar to C#'s async keyword).

Namespace

GuzzleHttp\Promise

Code

public function otherwise(callable $onRejected) {
  return $this->result
    ->otherwise($onRejected);
}