Update lib/elixir/lib/record.ex
Use record field value in the exception message
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user