Class: EmailFuse::Error::RateLimitExceededError

Inherits:
ServerError
  • Object
show all
Defined in:
lib/email_fuse/errors.rb

Overview

code 429

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, code = nil, headers = {}) ⇒ RateLimitExceededError

Returns a new instance of RateLimitExceededError.



23
24
25
26
27
28
29
# File 'lib/email_fuse/errors.rb', line 23

def initialize(msg, code = nil, headers = {})
  super(msg, code, headers)
  @rate_limit_limit = headers["ratelimit-limit"]&.to_i
  @rate_limit_remaining = headers["ratelimit-remaining"]&.to_i
  @rate_limit_reset = headers["ratelimit-reset"]&.to_i
  @retry_after = headers["retry-after"]&.to_i
end

Instance Attribute Details

#rate_limit_limitObject (readonly)

Returns the value of attribute rate_limit_limit.



21
22
23
# File 'lib/email_fuse/errors.rb', line 21

def rate_limit_limit
  @rate_limit_limit
end

#rate_limit_remainingObject (readonly)

Returns the value of attribute rate_limit_remaining.



21
22
23
# File 'lib/email_fuse/errors.rb', line 21

def rate_limit_remaining
  @rate_limit_remaining
end

#rate_limit_resetObject (readonly)

Returns the value of attribute rate_limit_reset.



21
22
23
# File 'lib/email_fuse/errors.rb', line 21

def rate_limit_reset
  @rate_limit_reset
end

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



21
22
23
# File 'lib/email_fuse/errors.rb', line 21

def retry_after
  @retry_after
end