From: Zach Moazeni Date: 2010-04-16T01:40:19+09:00 Subject: Re: own exception classes Hey Bernard, I use this philosophy when designing code with custom exceptions: Only create exceptions that you (or other developers using your code) will rescue from. So if I notice I'm creating exceptions that never get rescued in my own code, and I don't have a valid reason for why another developer would rescue from it, I blast it. Likewise, I treat: begin .. rescue StandardError ... end and begin .. rescue ... end As code smells, and refactor that by creating an exception. Also if you do go down the path of creating custom exceptions, I've found that creating exceptions in the form of: class MyError < StandardError end tends to be the cleanest, but of course your mileage may vary. Here's a link to a project I'm currently working on that defines it's own exceptions. http://github.com/zmoazeni/harvested/blob/master/lib/harvest/api/base.rb#L23 I hope this helps. -- Zach Moazeni http://simplechatter.com -- Posted via http://www.ruby-forum.com/.