diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-08-31 03:16:28 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-08-31 03:16:28 +0000 |
commit | 12ff554cd476bd2c653d9fd331bbcabb71363f3a (patch) | |
tree | cba0755d5ae3731380370af405e4f7e51490b27c /actionpack/lib | |
parent | 785e1fa599050513f8d0b235338c771f04dcf422 (diff) | |
download | rails-12ff554cd476bd2c653d9fd331bbcabb71363f3a.tar.gz rails-12ff554cd476bd2c653d9fd331bbcabb71363f3a.tar.bz2 rails-12ff554cd476bd2c653d9fd331bbcabb71363f3a.zip |
Tighten rescue clauses. Closes #5985.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4885 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/caching.rb | 2 | ||||
-rwxr-xr-x | actionpack/lib/action_controller/cgi_ext/cgi_methods.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/dependencies.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/rescue.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/base.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/compiled_templates.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/debug_helper.rb | 2 |
7 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb index 5461a2eadd..7eecb15e9b 100644 --- a/actionpack/lib/action_controller/caching.rb +++ b/actionpack/lib/action_controller/caching.rb @@ -487,7 +487,7 @@ module ActionController #:nodoc: if f =~ matcher begin File.delete(f) - rescue Object => e + rescue SystemCallError => e # If there's no cache, then there's nothing to complain about end end diff --git a/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb b/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb index bb7be80560..6cb38a38f3 100755 --- a/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb +++ b/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb @@ -55,7 +55,7 @@ class CGIMethods #:nodoc: node = XmlNode.from_xml(raw_post_data) { node.node_name => node } end - rescue Object => e + rescue Exception => e # YAML, XML or Ruby code block errors { "exception" => "#{e.message} (#{e.class})", "backtrace" => e.backtrace, "raw_post_data" => raw_post_data, "format" => mime_type } end diff --git a/actionpack/lib/action_controller/dependencies.rb b/actionpack/lib/action_controller/dependencies.rb index 0f4c16cad4..d316552f49 100644 --- a/actionpack/lib/action_controller/dependencies.rb +++ b/actionpack/lib/action_controller/dependencies.rb @@ -71,7 +71,7 @@ module ActionController #:nodoc: require_dependency(dependency.to_s) rescue LoadError => e raise LoadError.new("Missing #{layer} #{dependency}.rb").copy_blame!(e) - rescue Object => exception + rescue Exception => exception # error from loaded file exception.blame_file! "=> #{layer} #{dependency}.rb" raise end diff --git a/actionpack/lib/action_controller/rescue.rb b/actionpack/lib/action_controller/rescue.rb index 7cd05eab32..dd670fe96d 100644 --- a/actionpack/lib/action_controller/rescue.rb +++ b/actionpack/lib/action_controller/rescue.rb @@ -78,7 +78,7 @@ module ActionController #:nodoc: def perform_action_with_rescue #:nodoc: begin perform_action_without_rescue - rescue Object => exception + rescue Exception => exception # errors from action performed if defined?(Breakpoint) && params["BP-RETRY"] msg = exception.backtrace.first if md = /^(.+?):(\d+)(?::in `(.+)')?$/.match(msg) then diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index b38501359c..f3e2347d45 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -510,7 +510,7 @@ module ActionView #:nodoc: else CompiledTemplates.module_eval(render_source, 'compiled-template', -line_offset) end - rescue Object => e + rescue Exception => e # errors from template code if logger logger.debug "ERROR: compiling #{render_symbol} RAISED #{e}" logger.debug "Function body: #{render_source}" diff --git a/actionpack/lib/action_view/compiled_templates.rb b/actionpack/lib/action_view/compiled_templates.rb index a00a7578bb..deb730f4da 100644 --- a/actionpack/lib/action_view/compiled_templates.rb +++ b/actionpack/lib/action_view/compiled_templates.rb @@ -55,7 +55,7 @@ module ActionView begin module_eval(method_def, fake_file_name, initial_line_number) @mtimes[full_key(identifier, arg_names)] = Time.now - rescue Object => e + rescue Exception => e # errors from compiled source e.blame_file! identifier raise end diff --git a/actionpack/lib/action_view/helpers/debug_helper.rb b/actionpack/lib/action_view/helpers/debug_helper.rb index 8baea6f450..9e92813a18 100644 --- a/actionpack/lib/action_view/helpers/debug_helper.rb +++ b/actionpack/lib/action_view/helpers/debug_helper.rb @@ -7,7 +7,7 @@ module ActionView begin Marshal::dump(object) "<pre class='debug_dump'>#{h(object.to_yaml).gsub(" ", " ")}</pre>" - rescue Object => e + rescue Exception => e # errors from Marshal or YAML # Object couldn't be dumped, perhaps because of singleton methods -- this is the fallback "<code class='debug_dump'>#{h(object.inspect)}</code>" end |