> On Jun 10, 2015, at 2:37 AM, Dmitry Stogov <dmi...@zend.com> wrote: > > I also like EngineException more than Error. >
I think EngineException has a couple of problems with it: 1) EngineException doesn’t really accurately represent the reason for the error. For example, passing the wrong type to a function isn’t an ‘engine' problem, it’s an error in user code. In the future it may be desirable to add more classes in this exception branch, and I think a more general name would be more desirable. 2) The name EngineException implies it descends from Exception. I worry that this will cause a lot of confusion for users thinking they have to be catching Exceptions when the problem is actually an error in their code. Discussing why you should not catch Error objects is easier than trying to explain why certain Exception objects should not be caught. Error is best choice for the name of the second exception branch. It has precedent in other languages and is less likely to cause confusion. Most user code that would collide with the name is likely very outdated, but still could easily be updated in only a few minutes. Regards, Aaron Piotrowski