Exception: CloudParty::Errors::RequestError

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj:, method:, code:, response:, endpoint:) ⇒ RequestError

Returns a new instance of RequestError.



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

def initialize(obj:, method:, code:, response:, endpoint:)
  @obj      = obj
  @method   = method
  @endpoint = endpoint
  @code     = code
  @response = response
end

Class 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 self.error_string
  # This method should be overridden
end

.extra_stringObject



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

def self.extra_string
  # This method should be overridden
end

Instance Method Details

#to_sObject



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

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