parsing primitive values in a try/catch block