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

Breadcrumb

  1. Drupal Core 11.1.x

ErrorFuture.php

Namespace

OpenTelemetry\SDK\Common\Future

File

vendor/open-telemetry/sdk/Common/Future/ErrorFuture.php

View source
<?php

declare (strict_types=1);
namespace OpenTelemetry\SDK\Common\Future;

use Closure;
use Throwable;

/**
 * @psalm-suppress MissingTemplateParam
 */
final class ErrorFuture implements FutureInterface {
    public function __construct(Throwable $throwable) {
    }
    public function await() : never {
        throw $this->throwable;
    }
    public function map(Closure $closure) : FutureInterface {
        return $this;
    }
    public function catch(Closure $closure) : FutureInterface {
        $c = $closure;
        unset($closure);
        try {
            return new CompletedFuture($c($this->throwable));
        } catch (Throwable $e) {
            return new ErrorFuture($e);
        }
    }

}

Classes

Title Deprecated Summary
ErrorFuture @psalm-suppress MissingTemplateParam

API Navigation

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