Your Library
Chapter 4 · Error HandlingExceptions, invariants, assertions, and failure contracts
Contents
Chapter 3

Error Handling

Exceptions, invariants, assertions, and failure contracts

Programs encounter invalid input, unavailable resources, and violated assumptions. This chapter explains how C++ reports failures with exceptions, when an error code is a better fit, and how invariants, assertions, and noexcept help define a type’s and function’s guarantees.

In this chapter

  1. 3.1Lesson 4: Error Handling