Sha256: f0a14bc950f51702c404db24d106f145262586ca91270c9339751d3fde2876d2

Contents?: true

Size: 578 Bytes

Versions: 13

Compression:

Stored size: 578 Bytes

Contents

module RakutenWebService
  class Error < StandardError
    def self.register(status_code, error)
      repository[status_code] = error
    end

    def self.repository
      @repository ||= {}
    end
  end

  class WrongParameter < Error; end
  Error.register(400, WrongParameter)

  class NotFound < Error; end
  Error.register(404, NotFound)

  class TooManyRequests < Error; end
  Error.register(429, TooManyRequests)

  class SystemError < Error; end
  Error.register(500, SystemError)

  class ServiceUnavailable < Error; end
  Error.register(503, ServiceUnavailable)
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rakuten_web_service-1.9.0 lib/rakuten_web_service/error.rb
rakuten_web_service-1.8.0 lib/rakuten_web_service/error.rb
rakuten_web_service-1.7.0 lib/rakuten_web_service/error.rb
rakuten_web_service-1.6.1 lib/rakuten_web_service/error.rb
rakuten_web_service-1.6.0 lib/rakuten_web_service/error.rb
rakuten_web_service-1.5.0 lib/rakuten_web_service/error.rb
rakuten_web_service-1.4.2 lib/rakuten_web_service/error.rb
rakuten_web_service-1.4.1 lib/rakuten_web_service/error.rb
rakuten_web_service-1.4.0 lib/rakuten_web_service/error.rb
rakuten_web_service-1.3.0 lib/rakuten_web_service/error.rb
rakuten_web_service-1.2.0 lib/rakuten_web_service/error.rb
rakuten_web_service-1.1.1 lib/rakuten_web_service/error.rb
rakuten_web_service-1.1.0 lib/rakuten_web_service/error.rb