Skip to content

Commit

Permalink
Log error on unhandled GenServer message by default (#5250)
Browse files Browse the repository at this point in the history
  • Loading branch information
fishcakez committed Sep 29, 2016
1 parent aef130c commit 82cd54b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/elixir/lib/gen_server.ex
Expand Up @@ -550,7 +550,14 @@ defmodule GenServer do
end

@doc false
def handle_info(_msg, state) do
def handle_info(msg, state) do
proc =
case Process.info(self(), :registered_name) do
{_, []} -> self()
{_, name} -> name
end
:error_logger.error_msg('~p ~p received unexpected message: ~p~n',
[__MODULE__, proc, msg])
{:noreply, state}
end

Expand Down

0 comments on commit 82cd54b

Please sign in to comment.