Sha256: f06a399aee198343cd7d310869c5f91bcaf090a592f35f64536a619d9855f590

Contents?: true

Size: 855 Bytes

Versions: 16

Compression:

Stored size: 855 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 500
  class InternalServerError < Error; end

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

end # Github

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
github_api-0.3.9 lib/github_api/error.rb
github_api-0.3.8 lib/github_api/error.rb
github_api-0.3.7 lib/github_api/error.rb
github_api-0.3.6 lib/github_api/error.rb
github_api-0.3.4 lib/github_api/error.rb
github_api-0.3.3 lib/github_api/error.rb
github_api-0.3.2 lib/github_api/error.rb
github_api-0.3.1 lib/github_api/error.rb
github_api-0.3.0 lib/github_api/error.rb
github_api-0.2.2 lib/github_api/error.rb
github_api-0.2.1 lib/github_api/error.rb
github_api-0.2.0 lib/github_api/error.rb
github_api-0.1.2 lib/github_api/error.rb
github_api-0.1.1 lib/github_api/error.rb
github_api-0.1.0 lib/github_api/error.rb
github_api-0.1.0.pre lib/github_api/error.rb