[erlang-questions] gen_server init returns {stop, Reason} and fails: possibly doc bug?
Max Lapshin
max.lapshin@REDACTED
Tue May 2 12:57:51 CEST 2017
Here: http://erlang.org/doc/man/gen_server.html#start_link-3 we can read
that start_link will return {error, Reason} if init callback returns
{stop, Reason}
Maybe I'm wrong, but it seems that it is not possible to get back clean
reply, because gen_server.erl has following code:
proc_lib:init_ack(Starter, {error, Reason}), % here we may receive error
tuple
exit(Reason)
After exit caller is failing because of linkage. So if we want to have
start_link, we cannot get clean logs and clearly get {error, Reason} tuple.
Am I wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170502/e4180a20/attachment.htm>
More information about the erlang-questions
mailing list