Method: HP::Cloud::ErrorResponse#initialize

Defined in:
lib/hpcloud/error_response.rb

#initialize(error) ⇒ ErrorResponse

Returns a new instance of ErrorResponse.



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/hpcloud/error_response.rb', line 28

def initialize(error)
  @error = error
  if (error.respond_to?(:response))
    @error_string = parse_error(error.response)
  else
    begin
      @error_string = error.message
    rescue
      @error_string = error.to_s
    end
  end
end