Displaying 9 results from an estimated 9 matches for "rescue_action_locally".
2009 Aug 14
9
Rescuing from REXML::ParseException
...The problem that I''ve got is how to handle these
exceptions. In my application_controller.rb I have the following for
debugging purposes:
def rescue_action_in_public(exception)
respond_to do |request|
request.all { render :text => "Uh oh" }
end
end
and the same for #rescue_action_locally. It seems that if the Content-
Type header of the request is set to application/xml or application/
json then Rails ignores my exception rescuing code and goes back a
FAILSAFE 500 error. Anyone know why this is or what I''m doing wrong?
Thanks
2009 Feb 04
2
rendering error page for "Unauthorized" from before_filter
...so went into the rails source and tweaked the rescue module a bit
so that I surely get the ''public'' view of the exception:
def rescue_action_without_handler(exception)
(...)
if false && (consider_all_requests_local || local_request?) #
here
rescue_action_locally(exception)
else
rescue_action_in_public(exception)
end
(...)
That did not change anything, either. Am I not doing the proper thing?
Should I throw an exception (which one?) instead of rendering
something and setting the http status code of the response? Or is
renderi...
2007 Sep 08
1
Unknown Action doesn't raise exception ?
As I am in development environment, I wrote in my config/environment.rb
ActionController::Base.consider_all_requests_local = false
in my application.rb, I wrote
def rescue_action_in_public(exception)
case exception
when RoutingError, UnknownAction
render :file => "#{RAILS_ROOT}/public/404.html", :status =>
404
else
logger.error
2010 Jul 26
2
Exception Pages when behind a proxy
...a local error page with a stack trace, etc.
I''ve opened up a ticket on the rails bug tracker but I also would like
to verify that this is in fact a problem.
The bug is here:
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5166-actiondispatchshowexception-always-calls-rescue_action_locally-if-there-is-a-reverse_proxy
I believe there is a workaround - you could use rescue_from with
StandardError but then you are having to reproduce the exception type
to http error code logic. I also think this issue will/should be
affecting a bunch of other users as well.
Thanks,
Adam
--
You rece...
2005 Dec 21
2
Missing error page templates
...ib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/base.rb:195:in
`multilingual_old_render_file''
/vendor/plugins/multilingual/lib/multilingual/rails/action_view.rb:15:in
`render_file''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/rescue.rb:73:in
`rescue_action_locally''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/rescue.rb:31:in
`rescue_action''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/rescue.rb:108:in
`perform_action''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_...
2006 Jul 12
0
Strange error
.../lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:290:in
`render_template''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:249:in
`render_file''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:73:in
`rescue_action_locally''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:31:in
`rescue_action''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:108:in
`perform_action''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib...
2005 Dec 07
0
TypeError during a redirection
...oice#index
can''t convert String into Integer
RAILS_ROOT : script/../config/..
/usr/local/lib/ruby/gem/1.8/gems/actionpack-1.11.0/lib/action_controller/rescue:75:in
''[]=''
///usr/local/lib/ruby/gem/1.8/gems/actionpack-1.11.0/lib/action_controller/rescue:75:in
''rescue_action_locally''
/usr/local/lib/ruby/gem/1.8/gems/actionpack-1.11.0/lib/action_controller/rescue:31:in
''rescue_action''
/usr/local/lib/ruby/gem/1.8/gems/actionpack-1.11.0/lib/action_controller/rescue:108:in
''perform_action''
/usr/local/lib/ruby/gem/1.8/gems/actionpack-1...
2007 Oct 11
0
Custom rescue_action_* methods not being called?
...Here are my overrides in application.rb, none of which are being called
- they are all protected visibility (these are just for debugging
purposes, so please no comments on how dumb they look ;]):
def local_request?
puts "Calling custom local_request method"
false
end
def rescue_action_locally(exception)
puts "Calling custom rescue locally method"
end
def rescue_action_in_public(exception)
puts "rescue_action custom called"
render :text => "<html><body>
<p>There was a controller specfic error processing your request.</p>...
2010 May 06
0
Problems using exception_notification 2.3.3.0
...action_mailer/base.rb:395:in `method_missing''
/var/lib/gems/1.8/gems/exception_notification-2.3.3.0/lib/exception_notification/notifiable.rb:64:in `notify_about_exception''
/var/lib/gems/1.8/gems/exception_notification-2.3.3.0/lib/exception_notification/notifiable.rb:49:in `rescue_action_locally''
/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:152:in `rescue_action_without_handler''
/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:74:in `rescue_action''
/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_con...