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:
@@ -15,7 +15,7 @@ final readonly class ErrorKernel
|
||||
{
|
||||
|
||||
$log = new LogReporter();
|
||||
$log->report($e->getMessage());
|
||||
$log->report($e);
|
||||
|
||||
var_dump((string)$e);
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@ namespace App\Framework\ExceptionHandling\Reporter;
|
||||
|
||||
interface Reporter
|
||||
{
|
||||
public function report(string $message): void;
|
||||
public function report(\Throwable $e): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user