ets documentation | reasons for badarag

Helge Sychla <>
Tue Oct 5 11:02:49 CEST 2010


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.

Long story short the reason for the badarg exception was that my process did not have the 
necessary rights to write to the tables I wanted to edit. 
There is no mention on the whole ets page that a badarg exception is thrown without any further 
explanation if the process does not have the right rights.

I think that should be added. 
While I will surely not make that mistake again, other beginners might and will be just as frustrated as me yesterday.

Cheers
Helge

--
Dipl.-Ing. (FH) Helge Sychla



More information about the erlang-questions mailing list