soft-passio/api-exception-bundle
A PHP bundle for standardized API exception handling, converting errors into consistent JSON responses with configurable status codes and payloads. Helps keep API error output predictable and easy to debug across services.
application/problem+json) is the canonical way to make error payloads machine-parseable and self-documenting. This package is a ready-made implementation of that contract for Symfony applications, so it informs the "do we standardize error responses now or later?" decision.type/title/detail/instance fields, no stack traces in production, correlation IDs.Consider it only as a reference implementation or a short-lived stopgap when all of the following hold:
kernel.exception listener.Look elsewhere — or build — when:
App\Exceptions\Handler::render() plus a small problem+json serializer (e.g. crell/api-problem as the DTO layer). Do not attempt to install it in Laravel.Retry-After/rate-limit headers, i18n of detail messages.For executives (one paragraph): We evaluated a small open-source library that turns application errors into a standard, machine-readable JSON error format (RFC 7807). The idea is worth adopting — it makes our APIs easier for partners to integrate with and easier for us to support — but this particular library is not something to depend on: it is a Symfony-only component, last released in 2020, with no users and no maintainer. Recommendation: adopt the RFC 7807 standard, and have engineering implement the ~150 lines ourselves (or fork this as a reference) so we own the code path that runs on every failed request. Cost: under a week. Risk avoided: an unmaintained dependency in our error handling, which is both a reliability and an information-disclosure surface.
For engineering (talking points):
application/problem+json with type, title, status, detail, instance; suppresses traces outside dev; logs with a correlation ID that is echoed in instance.How can I help you explore Laravel packages today?