You can create custom exception the "symfony way" let's look at how exception or created in symfony:
first create your customExceptionInterface
namespace MySymfonyBundleException;
/**
* Interface for my bundle exceptions.
*/
interface MySymfonyBundleExceptionInterface
{
}
And create your jsonErrorException
namespace MySymfonyBundleException;
class HttpException extends Exception implements MySymfonyBundleExceptionInterface
{
}
Don't hesitate to browse symfony's exceptions code examples on github
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…