www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6410] New: Few common exceptions in std.exception


           Summary: Few common exceptions in std.exception
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc

--- Comment #0 from bearophile_hugs eml.cc 2011-07-30 07:04:25 PDT ---
I am not fond of deep hierarchies of exceptions, because it's hard to remember
them all, and use/catch them well. On the other hand there are very common
exceptions that I think are worth having in a standard library, inside
std.exception, as compromise.

A rough list (surely to be improved, and maybe few more to be added):

ArgumentException       thrown when an argument is wrong or out of bound
EmptyException          thrown when applied on an empty item/collection
IndexException          thrown tipically on out of bound situations
IOException             thrown by File in error situations
KeyException            thrown by library-defined associative/sets when a key
is missing.
MissingMethodException  thrown by ?
OverflowException       thrown on detected underflow/overflow situations (by
to!() too?)
IotaException           thrown on errors in iota() function
UncomparableException   thrown by user-defined opCmp() of classes

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 30 2011