Permalink
Browse files

Display 'put' errors when not in debug mode

  • Loading branch information...
candlerb authored and quirkey committed Feb 14, 2011
1 parent 98bfa61 commit 3d4cfb79eb978ec04296d6a72d9ad288479fa353
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/soca/pusher.rb
View
@@ -177,7 +177,11 @@ def put!(url, body = '')
logger.debug "PUT #{url}"
logger.debug "body: #{body[0..80]} ..."
response = Typhoeus::Request.put(url, :body => body)
- logger.debug "Response: #{response.code} #{response.body[0..200]}"
+ if response.success? || response.code == 412
+ logger.debug "Response: #{response.code} #{response.body[0..200]}"
+ else
+ logger.error "Response: #{response.code} #{response.body[0..200]}"
+ end
response
end

0 comments on commit 3d4cfb7

Please sign in to comment.