-
Notifications
You must be signed in to change notification settings - Fork 104
Closed
Labels
Description
I was just testing your cool parser and came across the following
"Chris"[35]
This returns Exception has been thrown by the target of an invocation. - not a very friendly message.
I tracked it down to the following line
2926 else if (itemProperties?.Length > 0)
*2927 return itemProperties[0].GetValue(left, oIndexingArgs.Cast<object>().ToArray());
2928 else
I changed the code to this
try
{
return itemProperties[0].GetValue(left, oIndexingArgs.Cast<object>().ToArray());
}
catch(Exception ex)
{
throw new Exception($"Invalid index speciifed '{string.Join(",",oIndexingArgs.Cast<object>().ToArray())}' for '{left}'");
}
This results in something like this
Invalid index specified '35' for 'Chris'