function PromiseInterface::otherwise
Same name in this branch
- 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
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\PromiseCode
public function otherwise(callable $onRejected) : PromiseInterface;