feat: implement exception handling system with error context and policies

This commit is contained in:
2025-11-01 15:46:43 +01:00
parent f3440dff0d
commit a441da37f6
35 changed files with 920 additions and 88 deletions

View File

@@ -20,6 +20,8 @@ use App\Framework\DI\DefaultContainer;
use App\Framework\Encryption\EncryptionFactory;
use App\Framework\ErrorHandling\CliErrorHandler;
use App\Framework\ErrorHandling\ErrorHandler;
use App\Framework\ErrorHandling\ErrorHandlerManager;
use App\Framework\ExceptionHandling\ExceptionHandlerManager;
use App\Framework\Http\MiddlewareManager;
use App\Framework\Http\MiddlewareManagerInterface;
use App\Framework\Http\ResponseEmitter;
@@ -71,7 +73,7 @@ final readonly class AppBootstrapper
//if ($envType->isDevelopment()) {
if($typedConfig->app->type->isDevelopment()) {
/*if($typedConfig->app->type->isDevelopment()) {
// Fehleranzeige für die Entwicklung aktivieren
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
@@ -87,7 +89,7 @@ final readonly class AppBootstrapper
return false;
}, true, true);
}
}*/
}
public function bootstrapWeb(): ApplicationInterface
@@ -157,7 +159,11 @@ final readonly class AppBootstrapper
private function registerWebErrorHandler(): void
{
$this->container->get(ErrorHandler::class)->register();
new ExceptionHandlerManager();
#var_dump('registerWebErrorHandler');
#$eh = $this->container->get(ErrorHandlerManager::class);
#$eh->register();
//$this->container->get(ErrorHandler::class)->register();
}
private function registerCliErrorHandler(): void