1

I have this function:

defp get_list(map, l, i) do

    list = l ++ map

where map is the new list who comes every repetition, so l is merged with it and attributed to list

it works great for a small number of pages, the problem is when lots of pages are being merged, some time after the lists are beind added to list the following error accurs:

(ArgumentError) argument error :erlang.++([0.33966522437570745,...]) (api_sort 0.1.0) lib/api_sort.ex:18: ApiSort.get_list/3

  • Which line is line 18? Is it the one with `list = l ++ map`? – legoscia Jul 30 '21 at 10:07
  • Hi. Are you sure that the arguments are always correct in terms of type? `Argument error` can be raised if the argument types are not what the BEAM expect. – ema Jul 30 '21 at 11:02
  • Yes, line 18 is this one! Well, thr format is always the same, two lists [] merger into one bigger list. – Elielton Limeira Jul 30 '21 at 11:34

1 Answers1

0

The prolem was that some of the 'maps' who comes from a site are not list type, even though they are all between [], so i made a condition is_list(map) and it prevented these fake lists to cause the error.