I've written functions to derive symbols based off of other symbols (i.e. spreads to outrights and vice/versa) and am finding that there's no possible way to detect if a symbol is even valid before calling sym(). Exception handling doesn't seem to work either.
Does not work for me as a method of trapping it either. The script just dies with an error. I'd prefer to not have to use an exception if there were another way anyway.
Code:
try { sym(potentially_invalid_symbol); } catch (err) { sym(other_symbol); }