...

/

Designing Interfaces with Error Handling

Designing Interfaces with Error Handling

Learn about the various types of errors and learn how to handle them effectively.

We'll cover the following...

Error-proofing interface design

Error handling is an important and often overlooked part of the interface of functions and classes. Error handling is a heavily debated topic in C++, but often the discussions tend to focus on exceptions versus some other error mechanism. Although this is an interesting area, there are other aspects of error handling that are even more important to understand before focusing on the actual implementation of error handling.

Obviously, both exceptions and error codes have been used in numerous successful software projects, and it is not uncommon to stumble upon projects that combine the two.

A fundamental aspect of error handling, regardless of programming language, is to distinguish between programming errors (also known as bugs) and runtime errors. Runtime errors can be further divided into recoverable runtime errors and unrecoverable runtime errors. When an unrecoverable error occurs, the program typically terminates immediately, so ...