Chapter 4. Exceptions and Assertions
Three kinds of errors occur in programs: user errors, runtime errors, and exceptions. User errors are expected because they’re likely to occur as the result of erroneous user input. Examples include naming nonexistent files, specifying badly formed numbers in spreadsheets, and presenting source programs with syntax errors to compilers. Programs must plan for and deal with such errors. Usually, functions that must cope with user errors return error codes — the errors are a normal part of the computation.
The checked runtime errors described in previous chapters are at the other end of the error spectrum. They are not user errors. They are never expected and always indicate program bugs. Thus, there is no way ...
Get C Interfaces and Implementations: Techniques for Creating Reusable Software now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.