UncaughtThrowable.php
Namespace
Revolt\EventLoopFile
-
vendor/
revolt/ event-loop/ src/ EventLoop/ UncaughtThrowable.php
View source
<?php
declare (strict_types=1);
namespace Revolt\EventLoop;
use Revolt\EventLoop\Internal\ClosureHelper;
final class UncaughtThrowable extends \Error {
public static function throwingCallback(\Closure $closure, \Throwable $previous) : self {
return new self("Uncaught %s thrown in event loop callback %s; use Revolt\\EventLoop::setErrorHandler() to gracefully handle such exceptions%s", $closure, $previous);
}
public static function throwingErrorHandler(\Closure $closure, \Throwable $previous) : self {
return new self("Uncaught %s thrown in event loop error handler %s%s", $closure, $previous);
}
private function __construct(string $message, \Closure $closure, \Throwable $previous) {
parent::__construct(\sprintf($message, \str_replace("\x00", '@', \get_class($previous)), ClosureHelper::getDescription($closure), $previous->getMessage() !== '' ? ': ' . $previous->getMessage() : ''), 0, $previous);
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
UncaughtThrowable |