www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Exception vs. Error

reply Lionello Lunesu <lio lunesu.remove.com> writes:
What's the difference between an Exception and an Error?

I know that Exceptions are meant to be recoverable and Errors are 
non-recoverable, but this doesn't help me since
(1) Error is derived from Exception (so any catch(Exception) can 
_recover_ from an Error), and
(2) there are also many catch(Error) which seems that an Error is not 
quite that bad.

Take Phobos for example. Why are some problems throwing an Error and 
others an Exception?

In either case, it seems like the Error class should not derive from the 
Exception class, since catching one should not consume the other.

Who has some clue what's going on there?

L.
Mar 26 2007
parent Lionello Lunesu <lio lunesu.remove.com> writes:
Seems I canceled that first post a few milliseconds too late :S
Mar 26 2007