Guys,

 I propose that we adopt the stdlib approach to errors printing with a
couple of changes. Right now it is very common for things in kernel
and stdlib to throw exceptions lie.

{error, {Line, Mod, Term}}

and then provide a function called format_error in the module called
named by 'Mod' to convert that into a string. I think we should do the
same but with a couple of differences in the organization. I would
like the reason to be more accessible at runtime so, they can be
matched on. The printing of an error message is secondary to
understand why something is being through. Also we can drop part of
this, in general we have the policy to throw exceptions instead of
returning errors. In those cases, the 'error' is not needed its
already a thrown exception.

throw({pe, Reason::term(), {Mod::module(), Line::integer()}})

In those few cases, where we explicitly return errors we may do the following

{error, {pe, Reason::term(), {Mod::module(), Line::integer()}}

In both these cases the pe indicates that an exception is printable
using the method described above.

I would like some consistent means of getting user readable exceptions
from the things that throw them. What do you guys think? Overkill?

Eric

-- 
You received this message because you are subscribed to the Google Groups 
"erlware-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/erlware-dev?hl=en.

Reply via email to