From: Jonathan Nielsen Date: 2010-04-16T01:41:00+09:00 Subject: Re: own exception classes On Thu, Apr 15, 2010 at 10:30 AM, Bernhard Brodowsky wrote: > I'm working at a bigger private project with my brother now and I wanted > to ask, in which cases you recommend own exception classes. > > One possibility would just be to use no own exceptions and just use > raise "message". One other possibility would be to use an own exception > class for every situation. What do you recommend? I would use exception classes for all but trivial cases. I sometimes use raise "message" for small projects as a placeholder for a better error message or for debugging, but that's about it... since the whole idea of exceptions is to catch them, it is far better to be able to 'rescue SomeTerribleException => e' than to have to rescue Exception => e and have to test the exception string to find out what went wrong (especially since the exception string can easily be changed without thinking about it!) In summary, exception classes. As to your other question, I'll defer that to those who know better... I just know that version control is your friend. -Jonathan Nielsen