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
Error Bundle

Error Bundle Laravel Package

shopery/error-bundle

A centralized error-handling bundle for Shopery applications that standardizes exception capture, formatting, and reporting. It turns uncaught exceptions into consistent, structured error responses and gives developers a single place to customize messages, logging, and HTTP status mapping.

View on GitHub
Deep Wiki
Context7

Manage what exceptions you throw and convert them to HttpException ones.

Frequently asked questions about Error Bundle
What is shopery/error-bundle used for?
shopery/error-bundle centralizes application error handling so uncaught exceptions become consistent, structured responses. It keeps controllers and middleware free of repetitive try/catch logic and gives you one place to customize messages, HTTP status mapping, and reporting. It is designed for Laravel and other PHP applications.
How do I install shopery/error-bundle in a Laravel app?
Install the package with Composer using composer require shopery/error-bundle. Then complete the Laravel service provider and configuration setup described in the repository README. The package is meant to be lightweight, so most applications should need only minimal configuration beyond the defaults.
Does shopery/error-bundle work with Laravel?
Yes, it is described as framework-friendly integration for Laravel and other PHP applications. It fits into Laravel's exception handling flow and normalizes exceptions into predictable error responses. Check the package composer constraints for the exact Laravel and PHP versions supported by your release.
How do I map custom exceptions to HTTP status codes?
Use the package's configurable exception mapping to associate your custom exception classes with the status codes and response behavior you want. You then throw your exceptions normally, and the bundle normalizes them into the configured structured response. See the README for the exact configuration keys and examples.
Can I customize the error response structure?
Yes, the package is extensible through handlers and custom rendering so you can control the response payload, messages, and formatting. It ships with sensible defaults for a consistent error shape, which you can adapt to your API conventions. Review the handler and renderer extension points in the documentation.
Does shopery/error-bundle replace Laravel's default exception handler?
The package is intended to centralize exception capture, formatting, and reporting rather than requiring try/catch blocks throughout your code. In Laravel, integrate it at the recommended point in your exception handling flow as described in the README. This keeps your existing framework behavior while giving you a consistent error API.
How should I test error responses with shopery/error-bundle?
Write feature or integration tests that trigger the exceptions you care about and assert the resulting HTTP status and response payload. Because the bundle normalizes output, you can assert one consistent structure across many exception types. You can also test custom handlers and mappings in isolation.
Is shopery/error-bundle suitable for production use?
It is designed as a lightweight, configurable way to standardize exception handling, which can be appropriate for production Laravel applications. Before deploying, review your exception mappings, logging handlers, and whether sensitive exception details are exposed to clients. Test the configured responses in staging to confirm they match your API contract.
Can I log exceptions with shopery/error-bundle?
Yes, the package provides extensible handlers for logging, localization, and custom rendering. You can configure a handler to report exceptions while still returning the normalized error response. Be mindful of avoiding duplicate logging if Laravel's default reporting is also enabled.
What are alternatives to shopery/error-bundle?
Alternatives include Laravel's built-in exception handler and custom middleware or renderers, as well as general PHP error-handling libraries. shopery/error-bundle is focused on consistent structured responses and configurable exception mapping with minimal setup. Choose it if you want a centralized, lightweight error layer rather than building the same normalization yourself.
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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
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