Chapter 9. Error Handling
Error handling is a loosely formalized field of software engineering concerned with treating error situations that are possible and expected but prevent the normal functioning of a system. Exception handling is the current common approach to error handling in many of today’s languages (D included) and has spawned a large lore of guidelines, techniques, and even controversy.
Exceptions are a language feature dedicated to error handling via out-of-band, dedicated control paths. A function unable to return a meaningful result to its caller may throw an exception object that encodes the cause of the error. Throwing is a “get out of jail” card that relieves the function of its normal duties. The exception skips all callers ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access