Actually it looks like the notifier is not working at all. I went to an
action I knew it had no begin-rescue on the find as to test the notifier and
this is what I see on the logs:
ActiveRecord::RecordNotFound (Couldn''t find Section with ID=55):
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:357:in
`find''
/app/controllers/sections_controller.rb:30:in `edit''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in
`send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in
`perform_action_without_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in
`perform_action_without_benchmark''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in
`perform_action_without_rescue''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in
`measure''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in
`perform_action_without_rescue''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in
`perform_action''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in
`send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in
`process''
/usr/local/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in
`dispatch''
/usr/local/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:144:in
`process_request''
/usr/local/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:64:in
`process!''
/usr/local/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:55:in
`each_cgi''
/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each''
/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi''
/usr/local/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:55:in
`process!''
/usr/local/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:21:in
`process!''
/home/iflo/domains/admin.infocenter.iflo.com/rails/public/dispatch.fcgi:24
That tells me that the notifier is not working. Here''s the code that I
have
on my application.rb:
# Default reaction to application errors:
# * 404 - Show 404 html file
# * 500 - Show 500 html file and notify admin by email
def rescue_action_in_public(exception)
case exception
when ActiveRecord::RecordNotFound, ActionController::UnknownAction
logger.error "MOD rescue_action_in_public :: record not found or unknown
action, will deliver 404"
render(:file => "#{RAILS_ROOT}/public/404.html", :status =>
"404 Not Found")
else
logger.error "MOD rescue_action_in_public :: some exception, will deliver
500.html and notify admin"
render(:file => "#{RAILS_ROOT}/public/500.html", :status =>
"500 Error")
SystemNotifier.deliver_exception_notification self, request, exception,
@auth_user
end
end
Any poiners on why it is not being called would be apreciated. BTW, I''m
in
production mode and have restarted the server after changing the code so the
problem is not there.
Thanks in advance,
Adrian Madrid
On 9/23/05, Adrian Madrid
<aemadrid-kSB444ljgzMmlAP/+Wk3EA@public.gmane.org>
wrote:>
> I''m following the examples of the Agile book for system wide
notifications
> on exceptions (p. 451 and "Sample System Notifier" on p.511) but
it
> doesn''t look like it''s doing anything on errors from
templates
> (ActionView::TemplateError). Is there any way to catch those errors too and
> notify me by email instead of just getting "Application error
(Rails)"?
>
> Thanks in advance,
>
>
> --
> Adrian Madrid
> HyperX Inc.
> Mobile: 801.815.1870
> Office: 801.566.0670
> aemadrid-kSB444ljgzMmlAP/+Wk3EA@public.gmane.org
> www.hyperxmedia.com <http://www.hyperxmedia.com>
>
> 9000 S. 45 W.
> Sandy, UT 84070
>
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>
--
Adrian Esteban Madrid
aemadrid-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails