On Fri, Nov 16, 2012 at 1:43 AM, Brian Candler <lists / ruby-forum.com> wrote: > Justin Gamble wrote in post #1084635: >> What is the reason of doing the .new(...)in >> >> raise InsufficientFundsError.new (1234, 50, 100) >> >> ? > > If the exception doesn't take any arguments, you can just do > > raise InsufficientFundsError > > If the exception takes only one argument you can do > > raise InsufficientFundsError, 123 > > But if the initialize method takes multiple arguments, as far as I know > you must create an instance of the exception class explicitly. (Tested > with ruby 1.8) > > -- > Posted via http://www.ruby-forum.com/. > Is this a good way to use exceptions? Having an insufficent balance might be something the user finds exceptional, but I'd think it would be a standard sort of handling for a bank applicaion...