halloverden/symfony-http-exceptions-bundle
A Symfony bundle that provides HTTP-aware exception classes for your applications. Throw typed exceptions that map to status codes and render consistent error responses while keeping controllers and services clean. Integrates with Symfony's exception handling.
JsonResponse objects or throw new \Exception(). That directly supports a decision to publish a single, documented error shape for your API rather than N ad-hoc shapes scattered across controllers.Symfony\Component\HttpKernel\Exception\* (NotFoundHttpException, AccessDeniedHttpException, BadRequestHttpException, etc.), the honest answer for most teams is build: a small App\Exception\Http\* hierarchy plus one kernel.exception listener gives you the same outcome with zero supply-chain risk.application/problem+json roadmap item: If your roadmap includes machine-readable error payloads (type, title, status, detail, instance), a typed exception layer is a reasonable foundation — but this bundle does not appear to be a problem-details implementation. Treat it as a possible first step, not a solution; scope the serialization/formatting work separately.abort(), HttpException, and the exception handler's rendering pipeline. Do not let a "PHP package" shortlist blur that line.Adopt (pilot-only) when all of the following hold:
composer.json symfony/* constraints against your LTS version — bundles are notoriously version-pinned and this one has no evidence of a support matrix).Look elsewhere — or do not adopt — when:
halloverden/symfony-http-exceptions. You are effectively taking two dependencies to get one small behavior, and the wrapper is the part you could delete with no functional loss. Vendoring or reimplementing is strictly lower risk.HttpKernel\Exception\* handles the common status codes; #[MapRequestPayload] + symfony/validator handles 422s; symfony/error-handler handles rendering. Confirm the gap before adding a dependency.crell/php-problem-details or Symfony's own Problem Details support (7.3+) instead.Executives: This is a small, MIT-licensed Symfony helper for turning errors into consistent HTTP responses. It is cheap to try and cheap to remove — but it is also unproven: no stars, no known users, a single maintainer, and it wraps functionality Symfony largely provides already. Recommendation: do not make it a dependency of anything customer-facing. If we want consistent API errors, we should fund a short internal task to standardize them, which costs roughly the same and carries no third-party risk.
Engineering: The bundle is a DI/registration layer over halloverden/symfony-http-exceptions — a typed exception hierarchy plus a kernel.exception listener. Before adopting, we need three answers: (1) which Symfony versions are supported, (2) what the companion library's test coverage looks like, (3) what it does that Symfony\Component\HttpKernel\Exception\* plus one listener does not. If the answers are thin, we implement the same thing in-house (~1 day) and keep the dependency graph clean. Decision requested: approve the in-house standard as the default, and treat this package as reference material only.
How can I help you explore Laravel packages today?