diff --git a/bootstrap.php b/bootstrap.php index 0705a7d..3c92ba2 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -1,5 +1,8 @@ emergency($message, $context); } } + +EventLoop::setErrorHandler(function (\Throwable $e) { + if ($e instanceof UnhandledFutureError) { + $e = $e->getPrevious(); + } + if ($e instanceof SecurityException || $e instanceof SignalException) { + throw $e; + } + if (str_starts_with($e->getMessage(), 'Could not connect to DC ')) { + throw $e; + } + emergency((string) $e); +}); \ No newline at end of file