PHPackages                             tounaf/exception-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. tounaf/exception-bundle

ActiveSymfony-bundle[Debugging &amp; Profiling](/categories/debugging)

tounaf/exception-bundle
=======================

Exception handler for symfony project

v2.2.1(1y ago)11442[2 issues](https://github.com/kamakely/exception-bundle/issues)MITPHP

Since May 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kamakely/exception-bundle)[ Packagist](https://packagist.org/packages/tounaf/exception-bundle)[ RSS](/packages/tounaf-exception-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (12)Versions (33)Used By (0)

If you need to manage complexe exception in your application, this bundle is set for you . This bundle provides interface to facilitate the customization of the exception rendering in Symfony project. Each exception that you create has his own handler classe. Your exception will be scalable, maintenable, independent.

1 - Installation
----------------

[](#1---installation)

```
composer require tounaf/exception-bundle
```

### 2 - How to work

[](#2---how-to-work)

By default, this bundle handle exception and render a json response but you can customize this behavior with your needs (ex: html)

3 - Create custom execption handler
-----------------------------------

[](#3---create-custom-execption-handler)

Create an class and implement the PulseExceptionInteface interface. It contains two methods:

#### \*\* handleException: This method have Throwble as argument and returns a Symfony Response

[](#-handleexception-this-method-have-throwble-as-argument-and-returns-a-symfony-response)

#### \*\* supportsException: This method have Throwble as argument and return boolean.

[](#-supportsexception-this-method-have-throwble-as-argument-and-return-boolean)

Example:

First create Exception to handle through the app.

```
