O'Reilly logo

Navigating C++ and Object-Oriented Design by Gail Anderson, Paul Anderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

13.5. Uncaught Exceptions

When the exception mechanism searches catch handlers for a thrown exception, the signature of a catch handler must match the type of the exception. If a catch handler is not found as the stack unwinds, the exception is uncaught. By default, the exception mechanism calls terminate(), which stops your program. This section explores uncaught exceptions in more detail and shows you strategies for handling them in applications.

The terminate() Function

The exception mechanism calls terminate() with uncaught exceptions for any of the following reasons:

  • The exception mechanism cannot find a catch handler for a thrown exception in a program.

  • An exception object constructor throws an exception, either directly or indirectly, and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required