This post briefly explains why I commonly suggest that people replace error with fail when raising IOExceptions. The main difference between error and fail can be summarized by the following equations: In other words, any attempt to evaluate an expression that is an error will raise the error. Evaluating an expression that is a fail does not raise the error or trigger any side effects. Why does th