Exception: CFoundry::BadResponse

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cfoundry/errors.rb

Overview

Exception raised when the response is unexpected; usually from a server error.

Instance Method Summary collapse

Constructor Details

#initialize(code, body = nil) ⇒ BadResponse

Initialize, with the HTTP response code and body.



96
97
98
99
# File 'lib/cfoundry/errors.rb', line 96

def initialize(code, body = nil)
  @code = code
  @body = body
end

Instance Method Details

#to_sObject

Exception message.



102
103
104
# File 'lib/cfoundry/errors.rb', line 102

def to_s
  "target failed to handle our request due to an internal error (#{@code})"
end