riper/exception-transformer
Exception Transformer for Laravel turns thrown exceptions into consistent, structured responses. Map exception types to custom transformers to control status codes, messages, and error payloads, so API error output stays predictable and your exception handlers stay clean.
kernel.exception listener/subscriber in Symfony, or a Laravel exception handler's render/report hooks) versus depending on a third-party bundle for the same intercept point. The v2.0.0 release is maintenance-only (BC breaks, CI migration) and adds no capability, which tips this decision firmly toward build.kernel.exception event, and you have a hard constraint preventing you from writing a small listener.ExceptionTransformerBundle), not a Laravel package — it is not drop-in usable in a Laravel application. v2.0.0 raises the floor to PHP ≥7.4 and Symfony ≥4 but declares no PHP 8 or Symfony 5/6 support. Since current Laravel (9+) and Symfony (5.4+) require PHP 8.0+, adopting this would force or risk pinning an end-of-life runtime. Verify against your actual framework/PHP matrix before any spike.EventSubscriberInterface on KernelEvents::EXCEPTION, or API Platform's error handling / ErrorListener.Handler::render() / report() overrides, or a package with active maintenance for API error envelopes.Executives: This is a small, effectively unmaintained third-party Symfony bundle (zero stars, zero downstream dependents, composite score 0.03) that nominally helps standardize how application errors are converted into user-facing responses. Its latest release, v2.0.0, is housekeeping only: breaking changes to drop PHP <7.4 and Symfony <4, Symfony 4 compatibility, and a move from Scrutinizer to GitHub Actions. No new functionality, and still no PHP 8 or Symfony 5/6 support. The capability is worth having; this package is not worth adopting — and it isn't even a Laravel package, so it cannot serve our primary stack. Recommendation: do not take on the dependency. The same outcome is achievable with a few dozen lines of first-party code on framework-native hooks, which removes the maintenance, security-review, EOL-runtime, and bus-factor risk at negligible cost.
Engineering: The requirement — transform exceptions into a consistent, redacted error contract — is legitimate and belongs in our platform standards. The proposed mechanism (intercepting before the kernel handles the exception) is non-standard and offers no advantage over a kernel.exception subscriber. The v2.0.0 release is a BC-only modernization to PHP 7.4 / Symfony 4 that lands behind our current runtime baseline (PHP 8.1+, Symfony 5.4+/6, Laravel 10/11), so it cannot be adopted without downgrading or forking. Given the package's abandonment, zero adoption, and version incompatibility, we should implement error transformation in-house behind a narrow interface: map domain exceptions to HTTP/problem types, log the original with a correlation ID, and render the sanitized form. This keeps us framework-idiomatic, testable, and free of an unmaintained dependency — and it's a small, well-scoped slice of work rather than a roadmap item.
How can I help you explore Laravel packages today?