O'Reilly logo

The D Programming Language by Andrei Alexandrescu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required