Exception: Enconvert::APIError

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

Overview

Raised for any HTTP response with status >= 400 that isn't one of the more specific subclasses below. status_code carries the HTTP status.

Direct Known Subclasses

AuthenticationError, QuotaError, RateLimitError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code, message) ⇒ APIError

Returns a new instance of APIError.



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

def initialize(status_code, message)
  @status_code = status_code
  super("[#{status_code}] #{message}")
end

Instance Attribute Details

#status_codeObject (readonly)

Returns the value of attribute status_code.



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

def status_code
  @status_code
end