[phobos] Exception chaining
Jonathan M Davis
jmdavisProg at gmx.com
Wed Jan 12 00:16:23 PST 2011
On Wednesday 12 January 2011 00:10:59 Don Clugston wrote:
> * It is still possible to throw an Object which isn't derived from
> Throwable. Can we disallow this?
I don't understand why it was ever allowed. Permitting you to throw something
not derived from a common exception class seems incredibly stupid. I hate the
fact that C++ does it, and I was surprised when I learned that D propagated the
mistake. And especially since we pretty much seem to act like everything which
is thrown is derived from Throwable, I don't see why it isn't actually the case.
The Throwable, Exception, Error hierarchy makes sense. Allowing someone to throw
ints or strings or whatnot doesn't.
- Jonathan M Davis
More information about the phobos
mailing list