Sha256: cdedf76ead6151f4f15d0433333a146ffc942a907e09cb30e9d72cfad1edd008

Contents?: true

Size: 951 Bytes

Versions: 5

Compression:

Stored size: 951 Bytes

Contents

# encoding: utf-8

module Github
  class Error < StandardError
    attr_reader :response_message, :response_headers

    def initialize(message, headers)
      @response_message = message
      super message
    end

    def inspect
      %(#<#{self.class}>)
    end
  end # Error

  # Raised when Github returns the HTTP status code 400
  class BadRequest < Error; end

  # Raised when Github returns the HTTP status code 401
  class Unauthorised < Error; end

  # Raised when Github returns the HTTP status code 403
  class Forbidden < Error; end

  # Raised when Github returns the HTTP status code 404
  class ResourceNotFound < Error; end

  # Raised when Github returns the HTTP status code 422
  class UnprocessableEntity < Error; end

  # Raised when Github returns the HTTP status code 500
  class InternalServerError < Error; end

  # Raised when Github returns the HTTP status code 503
  class ServiceUnavailable < Error; end

end # Github

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
github_api-0.4.4 lib/github_api/error.rb
github_api-0.4.3 lib/github_api/error.rb
github_api-0.4.2 lib/github_api/error.rb
github_api-0.4.1 lib/github_api/error.rb
github_api-0.4.0 lib/github_api/error.rb