Doc or gen_event:notify/2 Error!
Gunilla Arendt
gunilla@REDACTED
Wed Sep 10 08:08:28 CEST 2003
Snip from the gen_event man page:
"Unless otherwise stated, all functions in this module fail
if the specified event manager does not exist or if bad
arguments are given"
The same goes for gen_server and gen_fsm.
Regards, Gunilla
"Martin J. Logan" wrote:
>
> 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}]} **
--
_____Gunilla Arendt______________________________________________
EAB/UKH/KD Erlang/OTP Product Development
Gunilla.Arendt@REDACTED +46-8-7275730 ecn 851 5730
More information about the erlang-questions
mailing list