From: Ryan Pavlik Date: 2003-11-04T08:55:19+09:00 Subject: Re: exceptions On Tue, 4 Nov 2003 08:49:48 +0900 Simon Kitching wrote: > Hi, > > I'm puzzled about how to associate custom information with an Exception > class I am throwing. > > In Java, I would do this > > MyException e = new MyException("foo", "bar", "baz"); > e.doSomething(); > e.setWidget(widget); > // now e is all set up, so throw it > throw e; > > Can this sort of thing be done in Ruby?? Yes, just subclass Exception and treat it like a normal class (since it is a normal class). I use this as some evil magic to implement a few things. -- Ryan Pavlik "Yeah, I mean what're the odds of those two brain cells bumping into each other admist all that emptiness?" - 8BT