1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Avoid unnecessary catching of Exception instead of StandardError.

This commit is contained in:
Dylan Smith 2012-06-17 03:26:10 -04:00
parent 7381968c08
commit c9891608aa
5 changed files with 8 additions and 8 deletions

View file

@ -370,7 +370,7 @@ module ActiveRecord
records.uniq.each do |record|
begin
record.rolledback!(rollback)
rescue Exception => e
rescue => e
record.logger.error(e) if record.respond_to?(:logger) && record.logger
end
end
@ -385,7 +385,7 @@ module ActiveRecord
records.uniq.each do |record|
begin
record.committed!
rescue Exception => e
rescue => e
record.logger.error(e) if record.respond_to?(:logger) && record.logger
end
end

View file

@ -286,7 +286,7 @@ module ActiveRecord
:name => name,
:connection_id => object_id,
:binds => binds) { yield }
rescue Exception => e
rescue => e
message = "#{e.class.name}: #{e.message}: #{sql}"
@logger.error message if @logger
exception = translate_exception(e, message)

View file

@ -264,19 +264,19 @@ module ActiveRecord
def begin_db_transaction
execute "BEGIN"
rescue Exception
rescue
# Transactions aren't supported
end
def commit_db_transaction #:nodoc:
execute "COMMIT"
rescue Exception
rescue
# Transactions aren't supported
end
def rollback_db_transaction #:nodoc:
execute "ROLLBACK"
rescue Exception
rescue
# Transactions aren't supported
end

View file

@ -92,7 +92,7 @@ module ActiveSupport
method = message.split('.').first
begin
send(method, ActiveSupport::Notifications::Event.new(message, *args))
rescue Exception => e
rescue => e
logger.error "Could not log #{message.inspect} event. #{e.class}: #{e.message} #{e.backtrace}"
end
end

View file

@ -331,7 +331,7 @@ module ActiveSupport
def load
begin
@codepoints, @composition_exclusion, @composition_map, @boundary, @cp1252 = File.open(self.class.filename, 'rb') { |f| Marshal.load f.read }
rescue Exception => e
rescue => e
raise IOError.new("Couldn't load the Unicode tables for UTF8Handler (#{e.message}), ActiveSupport::Multibyte is unusable")
end