On 4 Nov 2008, at 10:00, Sijo Kg wrote:
>
> Hi
> One more question related to this What I understood from your reply
> was rescue placed inside the begin end block(Am I right?)..Could you
> please tell how following working ?
>
> begin
> SDMailer.delive_to_send_mail_to_user(name,email_id,ticket_no) unless
> email_id.blank?
> end
> rescue Exception => e:
> puts e.to_s
>
> And the o/p is (here i gave delive deliberately instead of deliver)
> undefined method
> `delive_to_send_mail_to_online_user_on_ticket_creation'
> for SDMailer:Class
>
rescues can go in other places, eg
def some_method
...
rescue ...
...
end
so for example you can do
def some_method
begin
...
end
rescue ...
end
end
Although the use of a begin/end block doesn't really add anything.
Fred
>
> Sijo
> --
> Posted via http://www.ruby-forum.com/.
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---