There are a few good-answered questions like this for Magento 1, but I haven't found anything for Magento 2.
What should be the way for adding in custom module custom Exception class. Can I add some constant message renedered when custom exception is catched? I have foun 'heart' of exceptions in magento/framework/Exception
, but I am not sure if this is place which I should extend from, because there can be found some exception classes in symfony
vendor.
Are there any good practices for Magento 2 for custom Exceptions or do you think it is not worth adding our own exceptions and we should just customize message displayed or logged?