Better would be to simply use a method that takes a
Double
,
Integer
and
Byte
. Assuming you don't want that (for whatever reason you have) you should not use
Parse[
^] and wait for an
Exception
to be thrown. Better would be to use
TryParse[
^] instead. It returns a
Boolean
which lets you know wether the
String
could be parsed or not, in which case you can take appropriate action.
Furthermore you could throw a detailed
Exception
, such as
"Invalid String: Field 3"
, but debugging the input of the function is not very hard I would say. Calling a function such as this requires full knowledge of the internals of your function. As such the user would already know the function requires a
String
in format
"####0.####, ######0, ##0"
(well, sort of). Finding that it doesn't meet the requirement is easy enough and mentioning which field it is in your
Exception
adds little value.