Download the PHP package juliangut/slim-exception without Composer
On this page you can find all versions of the php package juliangut/slim-exception. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download juliangut/slim-exception
More information about juliangut/slim-exception
Files in juliangut/slim-exception
Package slim-exception
Short Description Slim HTTP exceptions and exception handling
License BSD-3-Clause
Homepage https://github.com/juliangut/slim-exception
Informations about the package slim-exception
slim-exception
Alternative Slim error handling with better response format negotiation, better exception logging and better development support
Installation
Composer
Usage
Require composer autoload file
Renderers
Custom error renderers are configured when using slim-exception error handlers. Fear not, out of the box ErrorHandler is a direct drop-in to change default Slim ErrorHandler
You can register your error renderers or completely change them
Whoops
Developers deserve a better and more informative error handling while in development environment
Whoops is a great tool for this purpose and its usage is integrated in this package. There is a special Whoops error handler which can be used as default exception handler for development
Given Whoops renderers are meant for development displayErrorDetails argument on Slim\Interfaces\ErrorRendererInterface::__invoke
won't be considered and stacktrace will always be displayed
The example of how to include Whoops error handler is in the code above
For you to use this handler you'll need to require whoops first. Additionally, Symfony's var-dumper plays nice with whoops so require it too
Handle all errors/exceptions
In order to fully integrate error handling with the environment you can register ExceptionHandler globally. In this way any triggered and unhandled error will be captured and treated by the error handler
Upgrade from 2.x
- Minimum PHP version is now 8.0
- Minimum Whoops version is now 2.15 as custom Inspector has been removed in favor of Whoop's frame filters
Contributing
Found a bug or have a feature request? Please open a new issue. Have a look at existing issues before.
See file CONTRIBUTING.md
License
See file LICENSE included with the source code for a copy of the license terms.
All versions of slim-exception with dependencies
ext-mbstring Version *
slim/slim Version ^4.11
willdurand/negotiation Version ^3.0