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

Breadcrumb

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

function EventLoop::setErrorHandler

Set a callback to be executed when an error occurs.

The callback receives the error as the first and only parameter. The return value of the callback gets ignored. If it can't handle the error, it MUST throw the error. Errors thrown by the callback or during its invocation MUST be thrown into the `run` loop and stop the driver.

Subsequent calls to this method will overwrite the previous handler.

Parameters

null|\Closure(\Throwable):void $errorHandler The callback to execute. `null` will clear the current handler.:

File

vendor/revolt/event-loop/src/EventLoop.php, line 307

Class

EventLoop
Accessor to allow global access to the event loop.

Namespace

Revolt

Code

public static function setErrorHandler(?\Closure $errorHandler) : void {
    self::getDriver()->setErrorHandler($errorHandler);
}

API Navigation

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