Exception vs. Error

Lionello Lunesu lio at lunesu.remove.com
Mon Mar 26 03:35:37 PDT 2007


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 there?

L.


More information about the Digitalmars-d-learn mailing list