On May 21, 10:48 am, "Gregory Brown" <gregory.t.br... / gmail.com>
wrote:
> On 5/20/07, anoosh <pay... / gmail.com> wrote:
>
> > Hi all
> > I have 2 questions?
> > 1)What are the meaning of  symbols(:var) and Instance variables(@x)
> > Ruby?(I know Java and C.If it is possible for you  tell me the
> > synonyms in these languages,please)
>
> > 2)How can I define my own exception handling in Ruby?
>
> Why does this sound like a homework assignment?

2) If by "your own exception handling" you mean, how do I catch and
throw my own custom exceptions, here's a snippet.

class MyOwnException < StandardError
end

raise MyOwnException, "Hello World!"

this will raise a custom exception class that you can use to handle
your own separate types of exceptions.  It's quite handy for
classifying your universe of exceptions for whatever class/api/handler/
cattle_prod you happen to be writing.

Cheers!