refactor: enhance error reporting and logging, add installer script

- Update `LogReporter` and `Reporter` interface to handle `Throwable` instead of `string`
- Simplify initializer discovery message in `ClassNotInstantiable` exceptions
- Remove unnecessary debug logs in `HttpRouter`
- Add `scripts/install-aliases.sh` for setting up console aliases
- Add minimal `console` script for Docker execution
This commit is contained in:
2025-11-03 14:21:10 +01:00
parent 1109b0f94b
commit bc7cdf5fed
7 changed files with 200 additions and 11 deletions

View File

@@ -15,7 +15,7 @@ final readonly class ErrorKernel
{
$log = new LogReporter();
$log->report($e->getMessage());
$log->report($e);
var_dump((string)$e);

View File

@@ -5,8 +5,22 @@ namespace App\Framework\ExceptionHandling\Reporter;
final class LogReporter implements Reporter
{
public function report(string $message): void
public function report(\Throwable $e): void
{
echo ("[log] " . $message);
echo "<pre>\n";
echo $e->getMessage();
echo "\n";
echo $e->getFile().':'.$e->getLine();
echo "\n";
echo "\n";
echo $e->getTraceAsString();
echo "</pre>\n";
}
}

View File

@@ -4,5 +4,5 @@ namespace App\Framework\ExceptionHandling\Reporter;
interface Reporter
{
public function report(string $message): void;
public function report(\Throwable $e): void;
}