
18 Feb
2008
18 Feb
'08
5:58 a.m.
On Sun, 17 Feb 2008, Philippa Cowderoy wrote:
The nicest use would be for converting between a more specific error type and a more general one that handles a wider range of errors - enabling us to keep tighter track of which errors are possible in a given piece of code. Bonus points for using it together with polymorphic variants where rethrow becomes rather trivial.
I guess it's about exception handling, not error handling, right? I thought that must be possible by plugging various exception types together, say data CustomException = IOExc IOError | NetworkExc NetworkException | ThreadExc ThreadingException Now you can turn any IOError to CustomException by wrapping it with IOExc.