[Issue 6410] New: Few common exceptions in std.exception
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jul 30 07:04:27 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6410
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 at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at 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: -------
More information about the Digitalmars-d-bugs
mailing list