kick-in / exception-handler-bundle
This bundles integrates an simple Exception Handler in your Symfony Application, which is capable of mailing the exact problem.
Installs: 16 859
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.3
- symfony/config: ~4.4|~5.4|~6.3
- symfony/dependency-injection: ~4.4|~5.4|~6.3
- symfony/event-dispatcher: ~4.4|~5.4|~6.3
- symfony/filesystem: ~4.4|~5.4|~6.3
- symfony/http-foundation: ~4.4|~5.4|~6.3
- symfony/http-kernel: ~4.4|~5.4|~6.3
- symfony/security-core: ~4.4|~5.4|~6.3
- symfony/twig-bundle: ~4.4|~5.4|~6.3
Requires (Dev)
- symfony/mailer: ~4.4|~5.4|~6.3
- symfony/swiftmailer-bundle: >=2.6.0
Suggests
- symfony/mailer: When you want to use the Symfony Mailer, install this bundle
- symfony/swiftmailer-bundle: When you want to use Swiftmailer, install this bundle
Conflicts
- twig/twig: <2.7.0
README
This bundles integrates an simple Exception Handler in your Symfony Application, which is capable of mailing the exact problem.
Upgrading
See the upgrade notes.
Installation
In order for this bundle to work, you are required to follow the following steps:
- Install the bundle:
php composer.phar require kick-in/exception-handler-bundle
- Enable the bundle in your
bundles.php
(if not done automatically)
$bundles = [ Kickin\ExceptionHandlerBundle\KickinExceptionHandlerBundle::class => ['all' => true], ];
- Choose the mail backend in the configuration. For example, for SwiftMailer:
kickin_exception_handler: mail_backend: 'swift' # One of "swift"; "swift_mailer"; "symfony"; "symfony_mailer"
-
Implement your custom configuration service. This should implement either
Configuration\SwiftMailerConfigurationInterface
or
Configuration\SymfonyMailerConfigurationInterface
, depending on you mail backend choice.You can check a custom example implementation here.
-
Your configuration will be autowired to the correct ExceptionHandler if you have set
container.autowiring.strict_mode
to false. Otherwise, (default in Symfony >=4.0), alias theKickin\ExceptionHandlerBundle\Configuration\(Swift|Symfony)MailerConfigurationInterface
service to your custom configuration class. For example:
Kickin\ExceptionHandlerBundle\Configuration\SymfonyMailerConfigurationInterface: alias: 'App\ExceptionHandler\ExceptionHandlerConfiguration'
- [SwiftMailer only] Create the
exception_mailer
SwiftMailer instance. For example:
swiftmailer: default_mailer: default mailers: default: transport: "%mailer_transport%" exception_mailer: transport: "%mailer_transport%" spool: { type: memory }
That should be it, happy exception mailing!
Contributors
The original functionality has been created by WendoB, while BobV splitted the codebase into a separate bundle making it configurable for more users.
Problems
If you experience any problems, do not hesitate to create an issue (or PR if you're able to fix it)!