Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Api Exception Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is a Symfony bundle, not a Laravel package, so it does not integrate with Laravel's exception-handling pipeline at all (Laravel routes exceptions through App\Exceptions\Handler / Illuminate\Foundation\Exceptions\Handler, not a Symfony kernel.exception listener). If the target stack is genuinely Laravel, this package is the wrong shape. If the target is Symfony, it is a thin kernel.exception listener that converts thrown exceptions into application/problem+json RFC 7807 responses — a small, well-understood pattern.

Integration feasibility. The last release (June 2020) implies Symfony 4/5 and PHP 7.x-era compatibility. Modern Symfony 6/7 changed the KernelEvents::EXCEPTION listener signature and related interfaces; expect fatal errors or deprecations unless the package is patched. With zero stars, zero dependents, and no maintenance for ~5 years, there is no evidence anyone has validated it against current runtimes. Adoption cost is low for the initial install and high for the "make it work and keep it working" portion.

Technical risk.

  • Supply chain / abandonment: unmaintained, unpatched; no CVE response path. Treat as vendored code you now own.
  • Correctness risk: error-to-JSON conversion is exactly the code path that can leak stack traces, messages, or internal details into responses — the highest-sensitivity area for a security review.
  • Runtime risk: signature drift across Symfony majors; interaction with other exception listeners (logging, Sentry, profiler) is unverified.
  • Low value relative to risk: RFC 7807 rendering is ~40–80 lines of code, which makes depending on an abandoned 0-star bundle a poor trade.

Key questions.

  1. Is the actual stack Symfony or Laravel? (The task says Laravel; the package says Symfony.)
  2. Which Symfony and PHP versions are in production, and does the bundle's constraint set even install?
  3. Is there a hard requirement for RFC 7807, or is any consistent error envelope acceptable?
  4. What is the security review posture on error bodies (trace/message leakage)?
  5. Could we satisfy the same need with a small first-party listener, or a maintained alternative (e.g., Symfony's ProblemNormalizer, an in-house kernel.exception subscriber)?

Integration Approach

Stack fit. Only viable for Symfony applications on matching versions. For Laravel, do not adopt; implement RFC 7807 formatting inside the app's exception handler (a renderable closure or a small ProblemJson response class) — that keeps the behavior first-party and versionless.

Migration path. Rather than installing the abandoned bundle, prefer extracting its behavior: a first-party kernel.exception listener that (a) prioritizes exceptions, (b) maps exception → status → application/problem+json body, (c) strips internals in production. If the bundle is mandated, vendor/fork it into the repo, pin the commit, and add tests around the listener — this converts an unmaintained dependency into owned code with a known surface.

Compatibility. Before any work: confirm the constraint set installs against the current symfony/http-kernel and PHP version; grep for KernelEvents::EXCEPTION, GetResponseForExceptionEvent vs ExceptionEvent, and PSR-7/ProblemDetails dependencies. Any hard failure here is a stop signal.

Sequencing.

  1. Spike: one-day evaluation of the bundle against a staging Symfony app; capture install, behavior, and conflicts.
  2. Decide build-vs-adopt: if the spike shows any incompatibility, default to a first-party listener.
  3. Implement and test in isolation (unit tests over exception→response mapping, including leakage cases).
  4. Roll out behind a feature flag, compare against current error responses.
  5. Document ownership and the RFC 7807 contract for API consumers.

Operational Impact

Maintenance. Effectively zero upstream maintenance since 2020; the adopting team becomes the maintainer. Budget ongoing ownership: dependency bumps on every Symfony/PHP upgrade, plus a periodic review for the day the bundle blocks an upgrade.

Support. No vendor support, no active issue triage, no release cadence. Internal expertise is the only support channel; ensure at least one engineer understands the Symfony exception pipeline.

Scaling. Runtime cost is negligible — a single event listener on the exception path, invoked only on errors. Scaling concerns are organizational (who owns the fork), not computational.

Failure modes.

  • Hard failure: incompatible listener signature after a Symfony upgrade → uncaught exceptions or a fatal at boot.
  • Data leakage: verbose messages/traces in problem responses, especially if APP_DEBUG handling is mishandled.
  • Content negotiation: clients receiving application/problem+json where application/json was expected, or negotiation not honored.
  • Listener conflicts: ordering against logging/Sentry/profiler listeners silently changing behavior.
  • Silent swallowing: exceptions converted before logging, losing observability.

Ramp-up. Low to learn the bundle's surface (small codebase), moderate to own it (requires Symfony event/kernel knowledge and an opinion on the error contract). The real ramp-up is in establishing the RFC 7807 contract and leakage guardrails, which is necessary regardless of build-vs-adopt.

TPM recommendation. Do not take a production dependency on this bundle. Treat it as a reference implementation for an in-house RFC 7807 exception listener (or, on Laravel, a small handler-level formatter). If adoption is unavoidable, fork-and-pin, add tests, and assign an explicit owner before rollout.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle