Exception: SoapyCake::RequestFailed

Inherits:
Error
  • Object
show all
Defined in:
lib/soapy_cake/error.rb

Direct Known Subclasses

RateLimitError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, request_path: nil, request_body: nil, response_body: nil) ⇒ RequestFailed

Returns a new instance of RequestFailed.



9
10
11
12
13
14
# File 'lib/soapy_cake/error.rb', line 9

def initialize(message, request_path: nil, request_body: nil, response_body: nil)
  @request_path = request_path
  @request_body = request_body&.sub(ENV.fetch('CAKE_API_KEY'), '[redacted]')
  @response_body = response_body
  super(message)
end

Instance Attribute Details

#request_bodyObject (readonly)

Returns the value of attribute request_body.



7
8
9
# File 'lib/soapy_cake/error.rb', line 7

def request_body
  @request_body
end

#request_pathObject (readonly)

Returns the value of attribute request_path.



7
8
9
# File 'lib/soapy_cake/error.rb', line 7

def request_path
  @request_path
end

#response_bodyObject (readonly)

Returns the value of attribute response_body.



7
8
9
# File 'lib/soapy_cake/error.rb', line 7

def response_body
  @response_body
end