Bug 5220 – Make std.conv.ConvError an Exception instead of an Error

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2010-11-15T21:04:00Z
Last change time
2015-06-09T05:15:05Z
Assigned to
andrei
Creator
issues.dlang

Comments

Comment #0 by issues.dlang — 2010-11-15T21:04:58Z
std.conv.ConvError is an Error which makes it so that you can't catch it (unless you're willing to catch Errors, which you're not supposed to do). It should be an Exception so that it can be caught and handled in cases of failure rather than taking the whole program down with it just because to!() failed. Presumably, it should be renamed to ConvException as well.
Comment #1 by issues.dlang — 2010-11-15T21:07:45Z
As noted by dsimcha on Phobos list, ConvError should be left as a deprecated alias to ConvException for a few releases to mitigate code breakage.
Comment #2 by issues.dlang — 2012-01-20T23:29:32Z
This was already done a while ago.