Error Handling — Exceptions, Error Codes and Result Types
How a function tells its caller that it failed, on one quantity read three ways: an error code that a careless caller turns into a wrong price, an exception that leaves the normal path, and a result that holds either the answer or the error, with each language's own advice on when to use which.