https://blog.codinghorror.com/exception-driven-development/a...
https://stackoverflow.com/questions/2184935/performance-cost...
f, err := fn(...)
if err != nil {
...
}pattern. Which is better is really a matter of taste. To have error handling smattered all over the code seems more inelegant and messy to me.
Personally, from the perspective of a number parsing function, I think being passed an unparseable number counts as an "exceptional" situation- InvalidArgumentError- and I don't care which way it's returned- as an raised exception, or as an error object- as long as it's clearly documented, and the use matches the semantics of the function (NetworkNotAvailable is a better example of an exception where you're want to put something in the exception block)
Eric Lippert had a decent blog post[1] back in 2008 on this titled "Vexing Exceptions" with regards to .NET.
What do you expect it to do? Silently fail and move on?