Sha256: e87b448d2b6e9ccc2586d60af5cc8dfa38bf09278295736dee687ed17640d071

Contents?: true

Size: 407 Bytes

Versions: 2

Compression:

Stored size: 407 Bytes

Contents

require 'evrythng/error/client_error'

module Evrythng
  # Raised when Evrythng returns the HTTP status code 420
  class Error::EnhanceYourCalm < Evrythng::Error::ClientError
    # The number of seconds your application should wait before requesting date from the Search API again
    def retry_after
      @http_headers.values_at('retry-after', 'Retry-After').detect{|value| value }.to_i
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
evrythng-0.1.1 lib/evrythng/error/enhance_your_calm.rb
evrythng-0.1.0 lib/evrythng/error/enhance_your_calm.rb