On 05/10/14 23:50, Dmitry Olshansky wrote:

Seems like it should be possible to define multiple interfaces for
exceptions, and then catch by that (and/or combinations of such).

Each of interface would be interested in a particular property of
exception. Then catching by:

FileException with PermissionException

would mean OS-level permission viloated and it was during file access,

while

ProcessException with PermissionException would mean process
manipulation was forbiden, etc.

Of course, some code may be interested only in PermissionException side
of things, while other code may want to contain anything related to
files, and the catch-all-sensible-ones inside of the main function.

Why not just define two different PermissionException?

--
/Jacob Carlborg

Reply via email to