[Opt, Val]),
error
end;
+ [] ->
+ ?ERROR_MSG("unknown listen option '~s' for '~s' will be likely "
+ "ignored because the listening module doesn't have "
+ "any options", [Opt, Module]),
+ {ok, Val};
KnownOpts when is_list(KnownOpts) ->
?ERROR_MSG("unknown listen option '~s' for '~s' will be likely "
"ignored, available options are: ~s",
end
end;
false ->
- ?ERROR_MSG("unknown option '~s' for module '~s' will be"
- " likely ignored, available options are: ~s",
- [Opt, Module,
- misc:join_atoms([K || {K, _} <- Validators],
- <<", ">>)]),
+ case Validators of
+ [] ->
+ ?ERROR_MSG("unknown option '~s' for module '~s' "
+ "will be likely ignored because the "
+ "module doesn't have any options",
+ [Opt, Module]);
+ _ ->
+ ?ERROR_MSG("unknown option '~s' for module '~s' will be"
+ " likely ignored, available options are: ~s",
+ [Opt, Module,
+ misc:join_atoms([K || {K, _} <- Validators],
+ <<", ">>)])
+ end,
[{Opt, Val}]
end;
(_) ->