acseo/aierrorexplained-bundle
Symfony dev bundle that enhances the default error page with AI-powered explanations and fix suggestions using OpenAI. Includes caching to avoid repeat calls for the same exception and integrates via a custom runtime error handler and error controller.
ErrorHandler and ErrorController mechanisms. This makes it a natural fit for Symfony-based applications but introduces limited portability to non-Symfony PHP projects (e.g., Laravel, standalone PHP).ErrorController and Kernel hooks). Laravel incompatibility is high unless wrapped in a middleware/handler layer.openai-php/client (v1.x) introduces cost, rate-limiting, and API stability risks. Requires .env configuration for API keys.dev environments, which reduces production risk but limits use cases.ErrorHandler via composer.json is non-standard and may conflict with other bundles or custom error handling logic..env must be strictly protected (e.g., excluded from Git, rotated regularly). No mention of key validation or revocation.App\Exceptions\Handler) suffice, or are deeper kernel hooks needed?Whoops, Sentry) that could conflict or complement this?App\Exceptions\Handler to call OpenAI for logged/rendered errors.Illuminate\Foundation\Bootstrap\HandleExceptions to inject AI explanations into error views.openai-php/client with Laravel’s guzzlehttp/guzzle or spatie/laravel-openai for consistency.Illuminate\Cache).--dev flag).composer.json runtime error handler.bundles.php and framework.yml.OPENAI_CLIENT_KEY in .env.throw new \RuntimeException('test')).spatie/laravel-openai)..env for API key and cache config.QueryException, HttpException).dev environments (e.g., via APP_ENV checks).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| OpenAI API down/unavailable | Errors show without AI suggestions. | Fallback to static hints or cached responses. |
| API Key leaked/compromised | Unauthorized OpenAI usage; cost spikes. | Rotate keys; |
How can I help you explore Laravel packages today?