From: Brian Candler Date: 2010-02-14T02:43:18+09:00 Subject: Re: What is the best exception to use for bad Data State? Xeno Campanoli wrote: > def myPureVirtualMethod > raise ScriptError, "This should never be called. Daughter Classes > MUST define > their own." > end raise NoMethodError perhaps? > def validateThatThingMadeByPureVirtualMethodIsThere > unless theThingMMadeByPureVirtualMethodIsThere? > raise ScriptError, "That thingy isn't there." > end > end raise "That thingy isn't there" # RuntimeError class MissingThingyErrror < RuntimeError; end raise MissingThingyError, "That thingy isn't there" -- Posted via http://www.ruby-forum.com/.