- Enhance logging handlers (Console, DockerJson, File, JsonFile, MultiFile) - Improve exception and line formatters - Update logger initialization and processor management - Add Ansible playbooks for staging 502 error troubleshooting - Update deployment documentation - Fix serializer and queue components - Update error kernel and queued log handler
28 lines
579 B
PHP
28 lines
579 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Framework\ExceptionHandling;
|
|
|
|
use App\Framework\ExceptionHandling\Reporter\LogReporter;
|
|
use Throwable;
|
|
|
|
final readonly class ErrorKernel
|
|
{
|
|
public function __construct(
|
|
private ErrorRendererFactory $rendererFactory = new ErrorRendererFactory,
|
|
) {}
|
|
public function handle(Throwable $e, array $context = []): mixed
|
|
{
|
|
|
|
$log = new LogReporter();
|
|
$log->report($e->getMessage());
|
|
|
|
var_dump((string)$e);
|
|
|
|
$this->rendererFactory->getRenderer()->render();
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|