throw new RuntimeException('Telegram API error. Description: No response'); } $result = json_decode($result, true); if ($result['ok'] === false) { throw new RuntimeException('Telegram API error. Description: ' . $result['description']); } } /** * Handle a message that is too long: truncates or splits into several foreach ($messages as $key => $msg) { if ($this->delayBetweenMessages && $key > 0) { sleep(1); } $this->sendCurl($msg); } } protected function sendCurl(string $message): void { $key = $this->keyGenerate($record);
if (false === $this->keyExist($key)) {
$this->firedMessages[$key] = $record;
Cache::add($key, $record, 120);
$this->send($record['formatted']);
}
}
private function keyExist(string $key): bool
{
$record = $this->processRecord($record); } $record['formatted'] = $this->getFormatter()->format($record); $this->write($record); return false === $this->bubble; } /** } } // once the record exists, send it to all handlers as long as the bubbling chain is not interrupted try { if (true === $handler->handle($record)) { break; } } catch (Throwable $e) { $this->handleException($e, $record); $level = self::RFC_5424_LEVELS[$level]; } $level = static::toMonologLevel($level); $this->addRecord($level, (string) $message, $context); } /** * Adds a log record at the DEBUG level. * * @param array $parameters
* @return mixed
*/
public function __call(string $method, $parameters)
{
return $this->driver()->$method(...$parameters);
}
/**
* Create a new, on-demand aggregate logger instance.
*/
public static function __callStatic($method, $args)
{
if (!isset(self::$instance)) {
self::$instance= new LogManager();
}
return self::$instance->$method(...$args);
}
} if ($this->shouldntReport($e)) {
return;
}
try {
Log::log($this->defaultErrorLevelMap()[$this->getLogLevel($e)], $e->getMessage(), ['exception' => $e]);
} catch (\Throwable $ex) {
$this->render($ex);
$this->render($e);
throw $e;
}
*/
protected function handleException(Throwable $e): void
{
$handler = new Handler();
$handler->report($e);
$handler->render($e);
}
set_error_handler(function($level, $message, $file = '', $line = 0) {
$this->handleError($level, $message, $file, $line);
});
set_exception_handler(function($e) {
$this->handleException($e);
});
register_shutdown_function(function() {
$this->handleShutdown();
});
|
RuntimeException
|
|---|
RuntimeException:
Telegram API error. Description: Not Found
at /home/solomono/web/hetzner.solomono.net/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php:256
at Monolog\Handler\TelegramBotHandler->sendCurl()
(/home/solomono/web/hetzner.solomono.net/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php:230)
at Monolog\Handler\TelegramBotHandler->send()
(/home/solomono/web/hetzner.solomono.net/app/Classes/Logger/Handler/TelegramHandler.php:19)
at App\Classes\Logger\Handler\TelegramHandler->write()
(/home/solomono/web/hetzner.solomono.net/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:48)
at Monolog\Handler\AbstractProcessingHandler->handle()
(/home/solomono/web/hetzner.solomono.net/vendor/monolog/monolog/src/Monolog/Logger.php:400)
at Monolog\Logger->addRecord()
(/home/solomono/web/hetzner.solomono.net/vendor/monolog/monolog/src/Monolog/Logger.php:586)
at Monolog\Logger->log()
(/home/solomono/web/hetzner.solomono.net/app/Classes/Logger/LogManager.php:92)
at App\Classes\Logger\LogManager->__call()
(/home/solomono/web/hetzner.solomono.net/app/Classes/Logger/Log.php:17)
at App\Classes\Logger\Log::__callStatic()
(/home/solomono/web/hetzner.solomono.net/app/Exceptions/Handler/Handler.php:33)
at App\Exceptions\Handler\Handler->report()
(/home/solomono/web/hetzner.solomono.net/bootstrap/HandleExceptions.php:96)
at Bootstrap\HandleExceptions->handleException()
(/home/solomono/web/hetzner.solomono.net/bootstrap/HandleExceptions.php:36)
at Bootstrap\HandleExceptions->Bootstrap\{closure}()
|
<div class="scroll-seo-text"> <?php echo renderArticle(509) ?>
</div> </div><?}?>
if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
die; // TODO refactor - баг коли любий аякс на index.php
require('r_spisok.php');
} else {
require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
}
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
|
ParseError
|
|---|
ParseError:
syntax error, unexpected end of file
at /home/solomono/web/hetzner.solomono.net/templates/content/index_products.tpl.php:63
at require()
(/home/solomono/web/hetzner.solomono.net/index.php:164)
|
* @param int|null $traceOffset
* @return \Error
*/
protected function fatalErrorFromPhpError(array $error, $traceOffset = null)
{
return new \Error($error['message'], 0);
}
}
* Handle the PHP shutdown event.
*/
protected function handleShutdown(): void
{
if (!is_null($error = error_get_last()) && $this->isFatal($error['type'])) {
$this->handleException($this->fatalErrorFromPhpError($error, 0));
}
}
/**
* Determine if the error type is fatal.
set_exception_handler(function($e) {
$this->handleException($e);
});
register_shutdown_function(function() {
$this->handleShutdown();
});
}
/**
* Report PHP deprecations, or convert PHP errors to ErrorException instances.
|
Error
|
|---|
Error:
Exception thrown without a stack frame
at /home/solomono/web/hetzner.solomono.net/bootstrap/HandleExceptions.php:129
at Bootstrap\HandleExceptions->fatalErrorFromPhpError()
(/home/solomono/web/hetzner.solomono.net/bootstrap/HandleExceptions.php:108)
at Bootstrap\HandleExceptions->handleShutdown()
(/home/solomono/web/hetzner.solomono.net/bootstrap/HandleExceptions.php:40)
at Bootstrap\HandleExceptions->Bootstrap\{closure}()
|