From: Mat Brown Date: 2010-02-14T00:12:04+09:00 Subject: Re: What is the best exception to use for bad Data State? On Sat, Feb 13, 2010 at 03:10, Robert Klemme wrote: > On 02/13/2010 02:16 AM, Xeno Campanoli wrote: >> >> I don't want to use "ArgumentError" as this is a matter of data that may >> be programmed in a daughter class, and is not necessarily an argument. >> Specifically, the state of some object variables in this case. > > Can you provide more context information?  When do you want to throw? > > Kind regards > >        robert > > -- > remember.guy do |as, often| as.you_can - without end > http://blog.rubybestpractices.com/ > > Sounds like Xeno is looking for something equivalent to Java's IllegalStateException: http://java.sun.com/javase/6/docs/api/java/lang/IllegalStateException.html As far as I know, Ruby doesn't have a built-in exception with similar semantics. So the best bet would be to define your own.