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

Breadcrumb

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

function AbstractDriver::error

Invokes the error handler with the given exception.

Parameters

\Throwable $exception The exception thrown from an event callback.:

2 calls to AbstractDriver::error()
AbstractDriver::createCallbackFiber in vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php
AbstractDriver::invokeMicrotasks in vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php

File

vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php, line 394

Class

AbstractDriver
Event loop driver which implements all basic operations to allow interoperability.

Namespace

Revolt\EventLoop\Internal

Code

protected final function error(\Closure $closure, \Throwable $exception) : void {
    if ($this->errorHandler === null) {
        // Explicitly override the previous interrupt if it exists in this case, hiding the exception is worse
        $this->interrupt = static fn() => $exception instanceof UncaughtThrowable ? throw $exception : throw UncaughtThrowable::throwingCallback($closure, $exception);
        return;
    }
    $fiber = new \Fiber($this->errorCallback);
    
    /** @noinspection PhpUnhandledExceptionInspection */
    $fiber->start($this->errorHandler, $exception);
}

API Navigation

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