Dan Ackroyd wrote on 18/05/2015 18:38:
On 18 May 2015 at 15:39, Levi Morrison <le...@php.net> wrote:
I wouldn't group
TypeException in the same subtree as ParseException, for instance. One
happens at compile time and the other at run time, which means the
intent in what you catch is probably quite different.
TypeException is also different the other EngineExceptions, as it's an
exception that people will want to throw from their own code instead
of having a separate UserLandTypeException.

Except for testing, people shouldn't be throwing ParseException or
other EngineExceptions from their code.

Hm, I think we may be getting somewhere; it does seem plausible that some specific "catchable fatal errors" in PHP 5 should actually be converted to Exceptions rather than Errors/EngineExceptions.

Indeed, some of them have closely-corresponding exception classes in SPL, such as InvalidArgumentException:

> Exception thrown if an argument is not of the expected type.

Thus the problem is not in creating an Exception/Error distinction in the first place, but in not thinking about which cases belong on which side of the split.

Regards,
--
Rowan Collins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to