Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PromiseInterface.php

function PromiseInterface::otherwise

Same name in this branch
  1. 11.1.x vendor/guzzlehttp/promises/src/PromiseInterface.php \GuzzleHttp\Promise\PromiseInterface::otherwise()

[Deprecated] Registers a rejection handler for a promise.

This method continues to exist only for BC reasons and to ease upgrading between versions. It is an alias for:

```php $promise->catch($onRejected); ```

@template TThrowable of \Throwable @template TRejected

Parameters

callable(TThrowable): (PromiseInterface<TRejected>|TRejected) $onRejected:

Return value

PromiseInterface<T|TRejected>

Deprecated

3.0.0 Use catch() instead

See also

self::catch()

3 methods override PromiseInterface::otherwise()
FulfilledPromise::otherwise in vendor/react/promise/src/Internal/FulfilledPromise.php
Promise::otherwise in vendor/react/promise/src/Promise.php
RejectedPromise::otherwise in vendor/react/promise/src/Internal/RejectedPromise.php

File

vendor/react/promise/src/PromiseInterface.php, line 134

Class

PromiseInterface
@template-covariant T

Namespace

React\Promise

Code

public function otherwise(callable $onRejected) : PromiseInterface;

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal