Doc or gen_event:notify/2 Error!

Martin J. Logan mlogan@REDACTED
Wed Sep 10 00:12:37 CEST 2003


Hello,
   I have found an inconsistency in the docs.

The docs indicate that the return value for gen_event notify is as
follows:

notify(EventMgrRef, Event) -> ok

This makes sense as it is asynchronous. I pass a registered name to a
notify call and if the name is not registered I get an exit(). It is the
same badarg exit that one would expect from

unregistered_name ! message

I think that either the docs should be changed to

notify(EventMgrRef, Event) -> ok | exit() 

or more preferably the notify/2 function should not exit.

Cheers,
Martin


OUTPUT:

gen_event:notify(martin, martin).
 
=ERROR REPORT==== 9-Sep-2003::17:05:56 ===
Error in process <0.31.0> with exit value:
{badarg,[{gen_event,send,2},{erl_eval,do_apply,5},{shell,eval_loop,2}]}
 
** exited: {badarg,[{gen_event,send,2},
                    {erl_eval,do_apply,5},
                    {shell,eval_loop,2}]} **





More information about the erlang-questions mailing list