C++ Error Handling — Good Sources of Example Code?

Herb Sutter’s and Andrei Alexandrescu’s book C++ Coding Standards comes with a whole chapter on Error Handling and Exceptions including

  • Assert liberally to document internal assumptions and invariants
  • Establish a rational error handling policy, and follow it strictly
  • Distinguish between errors and non-errors
  • Design and write error-safe code
  • Prefer to use exceptions to report errors
  • Throw by value, catch by reference
  • Report, handle, and translate errors appropriately
  • Avoid exception specifications

Every topic also includes an example and I found it to be a very valuable resource.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)