# or raises a suitable error. +method+ should be a symbol, e.g: :put or :get.
def assert_method(method)
ok = request.send((method.to_s.downcase + "?").to_sym)
- raise OSM::APIBadMethodError.new(method) unless ok
+ raise OSM::APIBadMethodError, method unless ok
end
##
yield
end
rescue ActionView::Template::Error => ex
- ex = ex.original_exception
+ ex = ex.cause
if ex.is_a?(Timeout::Error) ||
(ex.is_a?(ActiveRecord::StatementInvalid) && ex.message =~ /execution expired/)