Why exceptions for error handling is so important

via Digitalmars-d digitalmars-d at puremagic.com
Thu Jan 15 12:25:37 PST 2015


On Thursday, 15 January 2015 at 19:19:22 UTC, Marc Schütz wrote:
> When you say "copy", I expect that to mean "do a bitwise copy 
> and call the postblit". Postblit is obviously not desired here, 
> but merely doing the bitwise copy is enough. That's a move, 
> because afterwards the original location isn't usable anymore 
> (the originating thread is dead).

Ah, yes, I was not thinking current D compiler internals, just 
"it is implementable". :)

But I think cheap/efficient exceptions are important since API 
consistency makes it easier to write correct code.

Single inheritance makes it difficult to use exceptions with 
multiple libraries since they want their own root exception. A 
solid ontology that outlines the most common qualities you want 
to filter would help a lot. Maybe also a classification mechanism 
that allows you to group exceptions from multiple libraries.

E.g.:
classify library1.EntityNotFound, library2.LookupFailure as 
NotFound;





More information about the Digitalmars-d mailing list