Error: '${testlist} expects integer as index. Got string instead in ${testlist}['${intval}']'!
From where do these error message deviations come from? I would expect one certain function to do the type check. Therefore the same error message is expected in all cases above.
All following codes have the same issue: By mistake a string is used as list index. But the error messages are different.
Code:
${testlist}['ABC'] : 4
Error message:
Error: 'Could not set variable '${testlist}['ABC']' with value '4'! Reason: list indices must be integers or slices, not str'!
Code:
Error message:
Error: 'The variable '${testlist}['ABC']' is not available!'!
Code:
Error message:
Error: '${testlist} expects integer as index. Got string instead in ${testlist}['${intval}']'!
From where do these error message deviations come from? I would expect one certain function to do the type check. Therefore the same error message is expected in all cases above.
I would prefer the last error message version. This also would avoid the 'slices' issue of the first one (see also https://github.com/test-fullautomation/python-jsonpreprocessor/issues/205#issuecomment-2044578868).