Error vs. Exception
There is confusion about the distinction of errors and exceptions for a long time, repeated threads in Haskell-Cafe and more and more packages that handle errors and exceptions or something between. Although both terms are related and sometimes hard to distinguish, it is important to do it carefully. This is like the confusion between parallelism and concurrency.
The first problem is that exception seem to me to be the historically younger term. Before there were only errors, independent from whether they are programming or I/O or user errors. In this article we want to use the term "exception" for expected but irregular situations at runtime and the term "error" for mistakes in the running program, that can be resolved only by fixing the program.
The history may have led to the identifiers we find today in the Haskell language and standard Haskell modules.
- Exceptions: ,Control.Exception.try,Control.Exception.catch,IOErrorControl.Monad.Error
- Errors: ,error,Prelude.catchDebug.Trace.trace
Prelude.catch vs. Control.Exception.catch
Even more confusion was initiated by Java programming language to use the term "exceptions" for programming errors like the
error handling = debugging
examples: GHC errors and exceptions
Modula-3 arithmetic library
2 When exceptions become errors
3 When errors become exceptions