The Right Approach to Exceptions

dennis luehring dl.soluz at gmx.net
Tue Feb 21 00:51:55 PST 2012


Am 20.02.2012 22:11, schrieb Juan Manuel Cabo:
> Yeah.. that is a problem! :-) Thanks for liking the idea, now we can
> talk about the fine details!!
>
> One way is to not let the user direct access to the associative array,
> but wrap the e.info["MyDetail"] call in a nothrow function, such as
> e.info("MyDetail"), and an e.hasInfo("MyDetail"), and of course:
> e.addInfo("MyDetail", value) and e.allInfoNames() or something.

if the key is missing i can't recover/control the error - now all my 
data is gone - a silly wraper which catches the 
key-does-not-exists-lets-just-return-null will not help here


More information about the Digitalmars-d mailing list