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

Breadcrumb

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

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

Create

Namespace

GuzzleHttp\Promise

Code

public static function exceptionFor($reason) : \Throwable {
    if ($reason instanceof \Throwable) {
        return $reason;
    }
    return new RejectionException($reason);
}

API Navigation

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