Exception: Demografix::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/demografix/errors.rb

Overview

Base class for every error the SDK raises. Carries the HTTP status (when one is known), the server-provided message, and the quota parsed from the rate-limit headers (when present).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, status: nil, quota: nil) ⇒ Error

Returns a new instance of Error.



10
11
12
13
14
# File 'lib/demografix/errors.rb', line 10

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

Instance Attribute Details

#quotaObject (readonly)

Returns the value of attribute quota.



8
9
10
# File 'lib/demografix/errors.rb', line 8

def quota
  @quota
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/demografix/errors.rb', line 8

def status
  @status
end