Hi Matthew and Edgar,
thank you both for your inputs. Using generic data types seems an elegant way of solving the issue (numeric is preferred over too generic data here). However, my primary question was about proper catching the "syntax error" (as mentioned by Edgar) when calling the method without catching the exception or solving the problem anywhere else, not about solving the problem with calling the method (sorry if I was not very clear about that right from the beginning). I can see that there is probably not a simple way to do it, so I close the thread, assigning the points. Thank you!
Michal