Let us assume very simple and dumb example of pattern extracting from some data list by Cases[]:
Cases[{{1}, {2}}, x_ -> x[[1]]]
One can run it and get
During evaluation of In[1]:= Part::partd: Part specification x[[1]] is longer than depth of object.
Out[1]= {1, 2}
What a hell, why x is not an array?
Or a little more complex example:
In[287]:= Cases[{"2","1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1"}, mList_String -> StringExtract[mList, All], 1]
During evaluation of In[287]:= StringExtract::strse: String or list of strings expected at position 1 in StringExtract[mList,All].
Out[287]= {{"2"},{"1", "0", "0", "0", "0", "1", "0", "0", "0", "0", "1", "0", "0", "0", "0", "1"}}
One can tell, that as we get after all an correct output there is no big problem in such warnings.
But if we go a little deeper the real problem rises:
In[304]:= Cases[{"2", "1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1"}, mList_String -> ToExpression[StringExtract[mList, All]], 1]
During evaluation of In[304]:= StringExtract::strse: String or list of strings expected at position 1 in StringExtract[mList,All].
During evaluation of In[304]:= ToExpression::notstrbox: StringExtract[mList,All] is not a string or a box. ToExpression can only interpret strings or boxes as Wolfram Language input.
Out[304]= {$Failed, $Failed}
Any correct result at all.
So, what is exact problem with Cases[] and how to fix it correctly (i managed to make a simple and dirty fix, but do not like it)?