[erlang-questions] clarify: gen_server:start_link/3 return values?

Aggelos Giantsios <>
Thu Apr 25 10:03:19 CEST 2013


On Thu, Apr 25, 2013 at 10:53 AM, Bengt Kleberg
<>wrote:

> Greetings,
>
> Should gen_server:start_link/3 return {error, Reason} if my init/1
> returns {stop, Reason}?
>

Hey there!

gen_server:start_link/3 should return {error, Reason} only if init/1 fails
with Reason.
In the case where init/1 returns {error, Reason} or ignore, the process
that calls gen_server:start_link/3 should fail with Reason or ignore
respectively.

Aggelos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130425/fd1c1ee6/attachment.html>


More information about the erlang-questions mailing list