DIP33: A standard exception hierarchy

Jacob Carlborg doob at me.com
Tue Apr 2 23:57:52 PDT 2013


On 2013-04-03 05:14, Steven Schveighoffer wrote:

> The example dictates we determine why the exception is thrown, yet that
> we can't catch the exact type, because we would have to duplicate the
> code block.
>
> So we somehow have to catch the base type and then manually verify it's
> one of the types we want, and rethrow otherwise.  If there is a better
> idea, I'd love to hear it.

My objection was mostly to "maybe we need to come up with a way to do 
that in normal code too". Exceptions are kind of weird in that you break 
what OO is all about, not having to know the exact type. You may not 
need that with exceptions either, depending on what you do with them.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list