More exception classes into Phobos?
Jacob Carlborg via Digitalmars-d
digitalmars-d at puremagic.com
Thu Mar 23 13:34:45 PDT 2017
On 2017-03-23 20:47, Walter Bright wrote:
> Thanks for expressing this better than I could have. Over time I've
> found that standardized Exception types seem to become less and less
> useful over just using "Exception" with an appropriate message.
A plain Exception is completely useless, it can just as well be an
assertion instead. Because it's not possible to extract any information
from the exception (except for trying to parse the message which is a
bad idea) resulting in not being able to act on a thrown exception.
Which then results in it being pointless to catch the exception in the
first place.
I think it's a bad design that it's possible created instances of
Exception, it should either be an abstract class or an interface.
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list