io:fread and report_error ?

Bengt Kleberg Bengt.Kleberg@REDACTED
Mon Nov 3 09:52:08 CET 2003


Jouni Ryno wrote:
>>From the document of the io:fread:
> 
> {error, What}
>         The read operation failed and the parameter What can be used as
>         argument to report_error/1 to produce an error message. 
>         
> report_error/1 ? Is this defined somewhere, could not find anywhere ...
> 

presumably this is a documentation error. imho it should be 
format_error/1. the idea is/was that any module that returns ''{error, 
What}'' (which function in the module that returns this does not 
matter), should have a format_error/1. the latter function will give a 
nice explanation of the error, meant for humans.

like plan9:
printf("%r");
if this is familiar.


bengt




More information about the erlang-questions mailing list