On Sun, 2009-10-04 at 14:07 -0700, Craig White wrote:
> On Sun, 2009-10-04 at 12:50 -0700, Craig White wrote:
>
> > # this part works...I get the e-mails
> > protected
> >
> > # Provides code to create an email generated upon error
> > def log_error(exception)
> > super(exception)
> > begin
> > ErrorMailer.deliver_snapshot(
> > exception,
> > clean_backtrace(exception),
> > session.instance_variable_get("@data"),
> > params,
> > request.env)
> > rescue => e
> > logger.error(e)
> > end
> > end
> ----
> as long as I am at this, I don't seem to get the environment or session
> values either (well, I know if the session is deleted, I wouldn't get
> any values but when I have an error in a valid session, I would expect
> to get the session values but I don't. @session and @env seem to
> generate errors.
>
> I have this code in error_mailer.rb
>
> <% for key, val in @session -%>
> <p><b><%= key %></b></p>
> <p><%= val.to_yaml.to_a.join("</p>\n<p> ") %></p>
> <% end -%>
>
> and similar for @env but both return empty sections.
>
> but similar using @params does return values.
----
something changed in Rails 2.3.2 and @params and @env are good but
@session seems to be nil - even when there is an active session.
If someone wants to toss me a bone here, I will adjust my code but for
now, I just commented out the @session section so I can move on.
Craig
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---