Exception: Bloomy::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/bloomy/errors.rb

Overview

Base class for API errors with status and response body

Direct Known Subclasses

NotFoundError, RateLimitError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status: nil, response_body: nil) ⇒ ApiError

Returns a new instance of ApiError.



14
15
16
17
18
# File 'lib/bloomy/errors.rb', line 14

def initialize(message, status: nil, response_body: nil)
  @status = status
  @response_body = response_body
  super(message)
end

Instance Attribute Details

#response_bodyObject (readonly)

Returns the value of attribute response_body.



12
13
14
# File 'lib/bloomy/errors.rb', line 12

def response_body
  @response_body
end

#statusObject (readonly)

Returns the value of attribute status.



12
13
14
# File 'lib/bloomy/errors.rb', line 12

def status
  @status
end