Sha256: c96a892be154683332f524ac77a8513521b643c8880c0e6057ddbb4ee43fec3b

Contents?: true

Size: 1.07 KB

Versions: 3

Compression:

Stored size: 1.07 KB

Contents

module Loopiator
  class ApiError < StandardError; end
  
  class AuthError < ApiError
    def message
      "You've supplied invalid authentication credentials. Please check your credentials and then try again."
    end
  end
  
  class RateLimitError < ApiError
    def message
      "You've reached the number of allowed API-requests within the given time period. Please wait a bit and then try again."
    end
  end
  
  class InvalidParameterError < ApiError
    def message
      "One or several parameters have invalid parameters supplied."
    end
  end
  
  class UnknownError < ApiError
    def message
      "An unknown error occurred while trying to request data from the API."
    end
  end
  
  class ConnectionError < ApiError
    def message
      "An unknown connection error occurred while trying to connect to the API."
    end
  end
  
  class DomainOccupiedError < ApiError
    def message
      "The domain is occupied."
    end
  end
  
  class InsufficientFundsError < ApiError
    def message
      "Insufficient funds. Please top up your prepaid account."
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
loopiator-0.4.2 lib/loopiator/errors.rb
loopiator-0.4.1 lib/loopiator/errors.rb
loopiator-0.4.0 lib/loopiator/errors.rb