Skip to Main Content
The D Programming Language
book

The D Programming Language

by Andrei Alexandrescu
June 2010
Intermediate to advanced content levelIntermediate to advanced
456 pages
14h 48m
English
Addison-Wesley Professional
Content preview from The D Programming Language

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.
Start your free trial

You might also like

Advanced UNIX Programming, Second Edition

Advanced UNIX Programming, Second Edition

Marc J. Rochkind
Learn LLVM 12

Learn LLVM 12

Kai Nacke

Publisher Resources

ISBN: 9780321659538Purchase book