Rate this book

Exceptional Ruby: Master The Art Of Handling Failure In Ruby (2000)

by Avdi Grimm(Favorite Author)
4.13 of 5 Votes: 2
languge
English
genre
review 1: Great book!Here are my quizz notes:- What is the diff bt raise and fail?=> no diff- Are raise//fail ruby keywords or methods?=> Kernel#raise (are methods)- Re-raise last exception=># With no arguments will re-raise exception in $! If nil then RuntimeError# note $! value is nil initialized as soon as the begin..rescue.end block terminatesraise- What is the third argument of raise and give an example of what to put there.=> the backtrace, use for example Kernel#caller- What is catch/throw used for?=> not related to exceptions, catch/throw allows you to quickly exit blocks back to a point where a catch is defined for a specific symbol- Diffs bt `redo` vs `retry`=> Both ruby keywords are used to re-execute parts of a loop but:redo only repeats the current iterationretry repeat... mores the whole loop from the start in 1.8 but in 1.9 gives SyntaxError: Invalid retryNote retry should only be used inside immediate rescue blocks- What can you use to ignore/continue/retry//etc on every ruby program error, console based?=> the `hammertime` gem. just require 'hammertime'- Test unit, describe the test helpers (assertions) forequality, check nothing raised, check something raised.=>assert_equal val1, val2assert_nothing_raised { block }# ensure some exception is not raisedassert_nothing_raised ArgumentError { block }# ensure something is raisedassert_raise { block }# ensure some exception is raisedassert_raise NameError { puts asd }
review 2: If you are a long term Rubyist, you probably know Avdi Grim and his writings. This little book covers a topic that lots of programming books just gloss over or skip altogether, exceptions. It's a thorough wrap-up of everything Rubyists should know about exceptions and even mentioned a couple of things that got me thinking about the way I deal with exceptions in Ruby, and that's after 8 or 9 years of using the language. Definitely recommended! less
Reviews (see all)
Skylar
really good and thought-provoking read. consider this a must-read for anyone writing a ruby library
sarah
Fun to read. Shows you how to think of a more rubyish way of handeling errors.
Mistik
Well worth the read. Short, but packed.
Write review
Review will shown on site after approval.
(Review will shown on site after approval)