Skip to content

Commit

Permalink
handle gproc reg expections
Browse files Browse the repository at this point in the history
  • Loading branch information
tsloughter committed Jul 10, 2012
1 parent 3f0838f commit 6369558
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/dwight_core/src/dwight_core_req_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ close(Pid) ->
init([Host, Port]) ->
{ok, Client} = cowboy_client:init([]),
{ok, Client2} = cowboy_client:connect(cowboy_tcp_transport, Host, Port, Client),
gproc:reg({n, l, {Host, Port}}, self()),
{ok, #state{key={Host, Port}, client=Client2}}.

try
gproc:reg({n, l, {Host, Port}}, self()),
{ok, #state{key={Host, Port}, client=Client2}}
catch
error:badarg ->
ignore
end.

%%--------------------------------------------------------------------

Expand Down

0 comments on commit 6369558

Please sign in to comment.