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

Exception Handler Laravel Package

phphd/exception-handler

PHPhD Exception Handler offers a structured way to manage exceptions in Laravel/PHP applications, with configurable handling and cleaner error responses for more predictable debugging and user-facing failures.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy on the error path. Every Laravel application accumulates bespoke error handling — try/catch scattered through controllers and services, instanceof chains in a hand-rolled handler, ad-hoc status code maps. This package is a candidate to replace that bespoke code with a maintained convention. The PM question is straightforward: is how we render and report failures a differentiator, or is it undifferentiated plumbing we should stop funding? For most teams it is the latter.
  • Standardizing an API error contract before it becomes expensive. If the roadmap includes public APIs, partner integrations, or a documented error-code taxonomy, a centralized handler is the enforcement point. This supports sequencing "define the error envelope" ahead of "open the API," rather than retrofitting a contract onto live consumers.
  • Reducing support load and time-to-triage. Consistent error codes, correlation IDs, and structured reporting context shorten incident diagnosis. That is an operational metric (fewer escalations, faster MTTR), not a code-cleanliness preference — which makes it defensible in a planning conversation.
  • Consistency across a multi-app or multi-tenant fleet. Organizations running several Laravel services drift in how failures surface to customers and how they reach observability tooling. One convention reduces per-team variance and makes onboarding and on-call rotation cheaper.
  • Scope of the 1.1.1 release. A patch release documented only by a compare link — no breaking changes, no deprecations, no new capability. It changes no product decision. Adoption rationale rests on the 1.0/1.1 feature set; 1.1.1 is a maintenance signal (the project is still being touched) and permission to pin and upgrade within ^1.1.

Decision this package does not settle: it is not an observability or alerting product. If the actual pain is "we don't know when things break," the answer is Sentry/Bugsnag/Flare plus Laravel's native handler, not this package.

When to Consider This Package

Adopt when:

  • Two or more Laravel apps duplicate exception rendering or reporting logic, or the same error-response shape is reimplemented per team.
  • You need one contract spanning web responses, JSON APIs, and queued job failures — the places Laravel's defaults most visibly diverge.
  • Platform-engineering capacity is thin and convention-over-configuration beats maintaining a custom handler in-house.
  • You want error paths to be unit- and feature-testable rather than buried in framework bootstrap code.
  • Vendor exceptions (Stripe, Guzzle, PDO) need centralized mapping — the config registry supports third-party types you cannot annotate.

Look elsewhere or defer when:

  • You are on Laravel 11+ and native withExceptions() already covers you. It often does. Adopting a package here buys convenience, not capability — establish the delta first. Mixing both mechanisms makes precedence non-obvious; pick one owner per exception.
  • You only need aggregation and alerting. Pair a monitoring vendor with the native handler.
  • The error contract is regulated, contractually specified, or must be fully owned in-house. Wrap any adoption in a thin internal adapter so the contract stays yours.
  • Diligence fails on critical-path risk. This code sits in the failure path of every request. Require test coverage, CI, a supported Laravel/PHP version matrix, recent release cadence, and a responsive maintainer. Current signals are thin: 1 GitHub star, a single-maintainer profile, and a bare compare link as the entire 1.1.1 changelog. Acceptable for an internal tool; risky as a platform-wide standard.
  • The description and documentation disagree. The package is described as a "bundle implementing exception handler via Symfony Messenger," while the documentation describes Laravel-native exception-flow integration. Resolve that discrepancy before adoption — it affects which framework contracts you are actually depending on and whether the Symfony Messenger framing implies async/queue semantics you have not evaluated.

Recommended gate before committing: read the actual 1.1.0→1.1.1 diff, reconcile the Symfony Messenger framing against the Laravel integration described in the docs, confirm the supported version matrix against your fleet, and run a one-service spike on your noisiest instanceof chain.

How to Pitch It (Stakeholders)

For executives: This is a small consolidation play, not a platform bet. It replaces hand-rolled error handling with a maintained convention, which makes what customers see when something fails more consistent and shortens the time support and on-call spend diagnosing incidents. Cost is one dependency — pinned, swappable, and contained behind an adapter. The honest caveat: the project is early-stage, effectively single-maintainer, and its latest release notes are a link to a diff. So the recommendation is evaluate in one non-critical service for a week, not standardize across the fleet. If the spike is clean, we get the consistency benefit at near-zero cost; if it isn't, we've spent a week and learned something about a class of dependency we will keep encountering.

For engineering: Adopt it to delete boilerplate — exception-to-response mapping, a consistent error envelope, and reporting context centralized instead of repeated across controllers and jobs. Error paths become testable, and handler precedence becomes an explicit, reviewable list rather than emergent behavior. Two conditions on adoption: (1) wrap it in a thin internal adapter so the dependency is swappable and our error contract remains ours, not the package's; (2) treat it as critical-path code — code review, pinned ^1.1, and a documented rollback. Practical notes for the spike: watch for double registration if you also use withExceptions(), config:clear after any registry change (the most common "my handler doesn't run" cause), guard HTTP-shaped responses against console and queue contexts, and never let getMessage() or traces reach a production client. 1.1.1 is a patch with no breaking changes, safe within the 1.x line — but read the diff first, and confirm whether the "Symfony Messenger" framing in the package description implies a transport or async concern the Laravel docs don't mention.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console