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

symkit/error-bundle

Symkit Error Bundle delivers centralized exception handling for Symfony apps: customizable error pages, structured JSON responses, logging hooks, and consistent debug/production behavior. Reduce boilerplate and standardize error reporting across your PHP projects.

View on GitHub
Deep Wiki
Context7

Premium error page templates for Symfony applications

Frequently asked questions about Error Bundle
What is symkit/error-bundle used for?
It provides a centralized error-handling layer for Symfony applications. It maps exceptions to HTTP status codes and custom handlers, renders consistent HTML or JSON error responses, hooks into structured logging, and keeps debug output useful in development while keeping production pages clean.
How do I install symkit/error-bundle with Composer?
Install it with composer require symkit/error-bundle. In a Symfony Flex project the bundle is usually registered automatically; otherwise enable it in config/bundles.php. Then add the bundle configuration shown in the README for your error pages, mappings, and logging preferences.
Does symkit/error-bundle work with Laravel?
No. symkit/error-bundle is a Symfony-native bundle built around Symfony services, configuration, and the Symfony error-handling flow. Laravel uses its own exception handler, so Laravel projects should use Laravel-specific error-handling packages instead.
Which Symfony versions does symkit/error-bundle support?
Check the composer.json constraints and the README for the supported Symfony versions before installing. Because it integrates directly with Symfony services and configuration, you should verify compatibility against your project’s Symfony version and dependency set.
How do I customize HTML and JSON error pages?
The bundle supports configurable error pages for formats such as HTML and JSON. You define the responses or templates you want per format and map exceptions to the appropriate handlers. The exact configuration keys and template paths are documented in the package README.
How does exception mapping to HTTP status codes work?
You configure mappings from exception classes to HTTP status codes and optionally to custom handlers. When an uncaught exception is processed, the bundle uses those mappings to choose the response behavior instead of scattering try/catch logic throughout your app. This makes status-code decisions consistent across controllers and services.
Can I log exceptions with context and severity?
Yes. The bundle is designed to integrate with Symfony logging and provides structured logging with context and severity control. You can route different exception types or environments through the logging behavior you configure, making production error reporting easier to standardize.
What is the difference between debug and production error output?
In development, the bundle is intended to show debug-friendly stack traces so you can diagnose failures quickly. In production, it renders consistent, safer error pages without exposing sensitive details. Environment-specific configuration lets you keep those two behaviors separate.
How can I test error handling with symkit/error-bundle?
Use Symfony functional tests with the KernelBrowser to call routes that trigger exceptions, then assert the status code, content type, and response body. Test both debug and production configurations so you cover stack-trace output and sanitized error pages. Keep test-specific mappings and logging settings in your test environment config.
What are alternatives to symkit/error-bundle for Symfony error handling?
Alternatives include Symfony’s built-in error handler and exception listener customization, API Platform’s error handling for API-focused projects, and problem-json style libraries. symkit/error-bundle is aimed at teams that want centralized exception mapping, configurable HTML and JSON error pages, and logging hooks in one Symfony-native package.
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.
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
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource