tryEval function

Try to evaluate an expression and return a default value if an error occurs or otherwise return its value.