Re: [VOTE] Exceptions in the engine

From: Date: Mon, 18 May 2015 15:39:03 +0000
Subject: Re: [VOTE] Exceptions in the engine
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  Groups: php.internals 
Request: Send a blank email to internals+get-86295@lists.php.net to get a copy of this message
On Sun, May 17, 2015 at 11:44 AM, Rowan Collins <rowan.collins@gmail.com> wrote: > On 17 May 2015 16:02:40 BST, Levi Morrison <levim@php.net> wrote: >>In this specific case we have broken all code out there. > > Yes, in the very specific case of people who both caught all exceptions and handled all > E_RECOVERABLE errors, the existence of Throwable introduces a slightly worse BC break than without > it. > > For code that catches all exceptions but doesn't handle any errors (which seems perfectly > reasonable to me), it improves BC, as they will catch only the same exceptions they already did. > > It's also worth looking at the feature in its own right: if we didn't have any BC > concerns, would it seem useful to be able to catch either all userland exceptions or all system > exceptions, or both? If you were defining from scratch you could have UserException and > EngineException extending Exception, but we can't change existing uses of Exception, so > Exception and Error implementing Throwable gives us the same split. I'm not sure I would have separated them this way. 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.

« previous php.internals (#86295) next »