I understand that introducing ApplicationException
to the exception hierarchy is retrospectively seen as a redundant move.
Likewise, I understand that there is no reason to derive application exceptions directly from SystemException
, and that Exception
should be generally used for this purpose. I can well imagine circumstances where derivation from ArgumentException
or IOException
could be a good idea, especially when implementing pre-existing interfaces designed/documented around those. However, deriving directly from SystemException
in a application code would seem to me just as a very confusing equivalent to deriving from Exception
, partly because I have no idea what SystemException
is trying to represent. (Today. Not historically.)
MSDN says: "Serves as the base class for system exceptions namespace. ... This class is provided as a means to differentiate between system exceptions and application exceptions." What a circular definition. The class serves as a way of distinguishing between types derived from it and types not derived from it.
The whole historical distinction between exceptions originating in application code and in system code seems to me obsolete, especially in dependency injection scenarios where the catch clauses or documented conventions existed long before the throw points; so there's tons of well written application code that throws exceptions derived from SystemException
.
Am I right in assuming that the raison d'être of SystemException
if there ever was one vanished hand in hand with the demise of ApplicationException
? Specifically, if this type suddenly disappeared from the inheritance hierararchy and its subclasses derived directly from Exception
, would any solid coding techniques in common use be lost?