You are here

function exception_for in Lockr 7.3

Create an exception for a rejected promise value.

Parameters

mixed $reason:

Return value

\Exception|\Throwable

3 calls to exception_for()
Coroutine::_handleFailure in vendor/guzzlehttp/promises/src/Coroutine.php
@internal
Promise::wait in vendor/guzzlehttp/promises/src/Promise.php
Waits until the promise completes if possible.
RejectedPromise::wait in vendor/guzzlehttp/promises/src/RejectedPromise.php
Waits until the promise completes if possible.

File

vendor/guzzlehttp/promises/src/functions.php, line 108

Namespace

GuzzleHttp\Promise

Code

function exception_for($reason) {
  return $reason instanceof \Exception || $reason instanceof \Throwable ? $reason : new RejectionException($reason);
}