You are here

function exception_for in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/promises/src/functions.php \GuzzleHttp\Promise\exception_for()

Create an exception for a rejected promise value.

Parameters

mixed $reason:

Return value

\Exception

3 calls to exception_for()
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.
__next_coroutine in vendor/guzzlehttp/promises/src/functions.php
@internal

File

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

Namespace

GuzzleHttp\Promise

Code

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