[erlang-questions] Package Support/Use

Dominic Williams xpdoka@REDACTED
Wed Nov 8 20:19:35 CET 2006


Hi Thomas,

Thomas Lindgren wrote :

> Higher-level handlers can only do so much when an
> exception arrives, e.g., log that "some file operation
> returned this POSIX error" or whatnot. This is because
> most of the context has been lost when the exception
> arrives.  This tends (in my experience) to push sensible
> error handling or reporting fairly close to the source of
> the exception. And as we get closer, tagged values start
> getting more attractive.

I would distinguish two usages of the word "context".

Low-level context, which I tend to call "details", is the
type of runtime error, where it occurred, and its immediate
context (operands or arguments). It seems to me that this
information is what you need to make a correction to the
code, but is useless to recover at runtime.

High-level context is higher up the call stack, and is what
was being attempted when the error occurred. This is where
the software can be designed to retry, or try an alternate
strategy, or give up, or ask for different input.

So, I would say that error reporting (or at least gathering
of error details) should occur close to the source, but not
handling.

Regards,

Dominic Williams
http://www.dominicwilliams.net

----



More information about the erlang-questions mailing list