Book Of Ruby - Chapter Nine: Exception Handling
The latest revision of The Book Of Ruby has just gone online. This now has nine chapters in 179 pages and comes complete with 150 little demo programs to illustrate every topic described in the text.
The latest chapter deals with exception handling. It covers all the basics of trapping general and specific types of exception, how to use one or more ‘rescue’ clauses to handle multiple-exception types, how to use the global exception variable and user-named variables, how to use ‘ensure’, ‘else’ and ‘retry’ in exception handlers, how to raise exceptions and how to make sense of Errno constants.
The Book Of Ruby is not tied specifically to the Ruby In Steel IDE and the code files can be loaded into any editor and run using the Ruby interpreter at the command line. The code is also provided in the form of a Solution file for Visual Studio 2008 which makes it easy to load up all the code of all the chapters and run the programs in the Ruby In Steel docked command window (just open one of the programs and press Ctrl+F5).
Chapter Nine brings us almost to the half-way point of this book. I will continue to add chapters regularly until the completed book of 20 chapters is all online. To keep up to date with the latest revisions, be sure to bookmark the download page.