3 ms·
I would say the same thing, but really it depends. Sometimes it really doesn’t matter what type of error it was, since all errors lead to the same outcome (prin
by db48x 3y ago
I would say the same thing, but really it depends. Sometimes it really doesn’t matter what type of error it was, since all errors lead to the same outcome (print a simple error message and exit). Sometimes you just don’t know what kind of errors you’ll be dealing with, usually because it’s early in the design of the program and you haven’t explored the design space yet. In cases like these, crates like anyhow make perfect sense. It lets you put off making any complicated decisions about error types until you need to and are ready to.