I am new to Symfony(using version 2.2) and trying to add a custom exception listener. I have read the following links but cannot get it to work.
You can create custom exception the "symfony way" let's look at how exception or created in symfony:
first create your customExceptionInterface
namespace My\SymfonyBundle\Exception;
/**
* Interface for my bundle exceptions.
*/
interface MySymfonyBundleExceptionInterface
{
}
And create your jsonErrorException
namespace My\SymfonyBundle\Exception;
class HttpException extends \Exception implements MySymfonyBundleExceptionInterface
{
}
Don't hesitate to browse symfony's exceptions code examples on github