[erlang-questions] ets documentation | reasons for badarag

Attila Rajmund Nohl <>
Tue Oct 5 15:30:57 CEST 2010


2010/10/5, Helge Sychla <>:
> Hello,
>
> I'm new here so please excuse me if I state the obvious or am missing
> something.
>
> I'm working with Erlang for a few months now and had a rather frustrating
> problem yesterday:
> I was working with ets tables, several processes and ets:update_element/3.
> ets:update_element threw a badarg exception so I looked it up in the
> documentation and found
>
> "The function will fail with reason badarg if:
>
>     * the table is not of type set or ordered_set,
>     * Pos is less than 1 or greater than the object arity, or,
>     * the element to update is also the key"
>
> so I checked my code for one of these three reasons but couldn't find any.

As far as I've noticed, ets will also return badarg if the table id is
not valid (i.e. there's no table with that id).


More information about the erlang-questions mailing list