Merge remote-tracking branch 'openstreetmap/pull/1030' into next
[rails.git] / config / initializers / abstract_adapter.rb
1 if defined?(ActiveRecord::ConnectionAdaptors::AbstractAdapter)
2   module ActiveRecord
3     module ConnectionAdapters
4       class AbstractAdapter
5         protected
6
7         alias old_log log
8
9         def translate_exception_class_with_timeout(e, sql)
10           if e.is_a?(Timeout::Error) || e.is_a?(OSM::APITimeoutError)
11             e
12           else
13             translate_exception_class_without_timeout(e, sql)
14           end
15         end
16
17         alias_method_chain :translate_exception_class, :timeout
18       end
19     end
20   end
21 end