lib/restly/connection.rb in restly-0.0.1.beta.2 vs lib/restly/connection.rb in restly-0.0.1.beta.3
- old
+ new
@@ -119,19 +119,23 @@
end
end
cache_log("Restly::CacheExpire", cache_key, :yellow) { Rails.cache.delete(cache_key) } if response.error
- raise Restly::Error::ConnectionError, "#{response.status}: #{status_string(response.status)}" if response.status >= 500
+ if response.status >= 500
+ site = URI.parse(client.site)
+ formatted_path = ["#{site.scheme}://#{site.host}", "#{site.port}", path].join
+ raise Restly::Error::ConnectionError, "#{response.status}: #{status_string(response.status)}\nurl: #{formatted_path}"
+ end
# Return the response
response
end
def request_log(name, path, verb, color=:light_green, &block)
site = URI.parse(client.site)
- formatted_path = ["#{site.scheme}://#{site.host}", path].join("/")
+ formatted_path = ["#{site.scheme}://#{site.host}", ":#{site.port}", path].join
ActiveSupport::Notifications.instrument("request.restly", url: formatted_path, method: verb, name: name, color: color, &block)
end
def cache_log(name, key, color=:light_green, &block)
ActiveSupport::Notifications.instrument("cache.restly", key: key, name: name, color: color, &block)
\ No newline at end of file