Download the PHP package tobento/service-error-handler without Composer
On this page you can find all versions of the php package tobento/service-error-handler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tobento/service-error-handler
More information about tobento/service-error-handler
Files in tobento/service-error-handler
Package service-error-handler
Short Description PHP errors and exceptions handling
License MIT
Homepage https://www.tobento.ch
Informations about the package service-error-handler
Error Handler Service
The Error Handler Service provides tools to manage errors and exceptions.
Table of Contents
- Getting started
- Requirements
- Highlights
- Documentation
- Error Handling
- Throwable Handlers
- Create Throwable Handlers
- Add Throwable Handler
- Restrict Throwable Handler
- Prioritize Throwable Handler
- Handle Throwable
- Handlers
- Debug
- Errors
- Log
- Credits
Getting started
Add the latest version of the error handler service project running this command.
Requirements
- PHP 8.0 or greater
Highlights
- Framework-agnostic, will work with any project
- Decoupled design
Documentation
Error Handling
Check out Throwable Handlers to learn more about the Throwable Handlers.
Throwable Handlers
The throwable handlers can be used where you need to handle exceptions in general.
Create Throwable Handlers
With autowiring factory
The autowiring factory is needed if you Add Throwable Handlers with dependencies.
Add Throwable Handler
By class instance
By class name
By class name with build-in parameters (not resolvable by autowiring)
By anonymous function
Restrict Throwable Handler
By error level(s)
The throwable handler will only be used on the specified error levels.
By exception(s)
The throwable handler will only be used on the specified exceptions.
Prioritize Throwable Handler
You might want to prioritize the excution order of the handlers by the following way (highest first):
Handle Throwable
Handlers
Debug
The debug handler will render a debugging page on any exception not caught.
Custom view
Check out View Service to learn more about the View in general.
Errors
The errors handler will render an error page on shutdown.
Custom error view
Check out View Service to learn more about the View in general.
Log
The log handler will log any errors or exceptions.
Example with Closure and throwable handlers
Credits
- Tobias Strub
- All Contributors
All versions of service-error-handler with dependencies
psr/log Version ^1|^2|^3
psr/container Version ^2.0
tobento/service-autowire Version ^1.0
tobento/service-view Version ^1.0