Exception: CloudParty::Errors::RequestError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cloud_party/exception.rb

Instance Method Summary collapse

Constructor Details

#initialize(message, method, endpoint, code, body) ⇒ RequestError

Returns a new instance of RequestError.



13
14
15
16
17
18
19
# File 'lib/cloud_party/exception.rb', line 13

def initialize(message, method, endpoint, code, body)
  super(message)
  @method   = method
  @endpoint = endpoint
  @code     = code
  @body = body
end

Instance Method Details

#error_stringObject

override error_string to provide your own error_string



30
31
32
# File 'lib/cloud_party/exception.rb', line 30

def error_string
  # This method should be overridden
end

#extra_stringObject



25
26
27
# File 'lib/cloud_party/exception.rb', line 25

def extra_string
  # This method should be overridden
end

#to_sObject



21
22
23
# File 'lib/cloud_party/exception.rb', line 21

def to_s
  [error_string.squish, extra_string].join("\n")
end