From f97b3cea18bc29ec0bbff7b78fd4e35815b3db8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 25 Nov 2012 20:15:32 +0100 Subject: [PATCH] Update lib/elixir/lib/record.ex Use record field value in the exception message --- lib/elixir/lib/record.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/elixir/lib/record.ex b/lib/elixir/lib/record.ex index 23d6243348..41fe17c4ee 100644 --- a/lib/elixir/lib/record.ex +++ b/lib/elixir/lib/record.ex @@ -519,10 +519,10 @@ defmodule Record do defp convert_value(atom) when is_atom(atom), do: { atom, nil } defp convert_value({ atom, other }) when is_atom(atom) and is_function(other), do: - raise ArgumentError, message: "record field #{inspect atom} cannot be a function" + raise ArgumentError, message: "record field value #{inspect atom} cannot be a function" defp convert_value({ atom, other }) when is_atom(atom) and (is_reference(other) or is_pid(other) or is_port(other)), do: - raise ArgumentError, message: "record field #{inspect atom} cannot be a reference, pid or port" + raise ArgumentError, message: "record field value #{inspect atom} cannot be a reference, pid or port" defp convert_value({ atom, _ } = tuple) when is_atom(atom), do: tuple