Program logic bugs vs input/environmental errors (checked exceptions)

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 5 23:33:39 PDT 2014


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


More information about the Digitalmars-d mailing list