C++.Coding.Standards.1918.Rules.Guidelines [Electronic resources]

Herb Sutter, Andrei Alexandrescu

نسخه متنی -صفحه : 521/ 357
نمايش فراداده

Summary

Consciously specify, and conscientiously apply, what so many projects leave to ad-hoc (mis)judgment: Develop a practical, consistent, and rational error handling policy early in design, and then stick to it. Ensure that it includes:

  • Identification: What conditions are errors.

  • Severity: How important or urgent each error is.

  • Detection: Which code is responsible for detecting the error.

  • Propagation: What mechanisms are used to report and propagate error notifications in each module.

  • Handling: What code is responsible for doing something about the error.

  • Reporting: How the error will be logged or users notified.

Change error handling mechanisms only on module boundaries.