function Create::exceptionFor
Create an exception for a rejected promise value.
Parameters
mixed $reason:
3 calls to Create::exceptionFor()
- 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/ Create.php, line 53
Class
Namespace
GuzzleHttp\PromiseCode
public static function exceptionFor($reason) : \Throwable {
if ($reason instanceof \Throwable) {
return $reason;
}
return new RejectionException($reason);
}