This is the base CouchRest exception class. Rescue it if you want to catch any exception that your request might raise. You can get the status code by e.http_code, or see anything about the response via e.response. For example, the entire result body (which is probably an HTML error page) is e.response.
# File lib/couchrest/exceptions.rb, line 60 def http_body @response.body if @response end
# File lib/couchrest/exceptions.rb, line 51 def http_code # return integer for compatibility @response.status if @response end
# File lib/couchrest/exceptions.rb, line 56 def http_headers @response.headers if @response end
# File lib/couchrest/exceptions.rb, line 64 def inspect "#{message}: #{http_body}" end
# File lib/couchrest/exceptions.rb, line 72 def message @message || self.class.default_message end
# File lib/couchrest/exceptions.rb, line 68 def to_s inspect end
# File lib/couchrest/exceptions.rb, line 76 def self.default_message self.name end
# File lib/couchrest/exceptions.rb, line 46 def initialize response = nil @response = response @message = nil end