Sha256: c655809aee5aab2f4d8913140e593da332156f8baba17cc49922826398b64077

Contents?: true

Size: 473 Bytes

Versions: 15

Compression:

Stored size: 473 Bytes

Contents

# encoding: utf-8

module Github #:nodoc
  # Raised when Github returns any of the HTTP status codes
  module Error
    class ServiceError < GithubError
      attr_accessor :http_headers

      def initialize(env)
        super(generate_message(env))
        @http_headers = env[:response_headers]
      end

      def generate_message(env)
        "#{env[:method].to_s.upcase} #{env[:url].to_s}: #{env[:status]} #{env[:body]}"
      end
    end
  end # Error
end # Github

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
github_api-0.6.3 lib/github_api/error/service_error.rb
github_api-0.6.2 lib/github_api/error/service_error.rb
github_api-0.6.1 lib/github_api/error/service_error.rb
github_api-0.6.0 lib/github_api/error/service_error.rb
github_api-0.5.4 lib/github_api/error/service_error.rb
github_api-0.5.3 lib/github_api/error/service_error.rb
github_api-0.5.2 lib/github_api/error/service_error.rb
github_api-0.5.1 lib/github_api/error/service_error.rb
github_api-0.5.0 lib/github_api/error/service_error.rb
github_api-0.5.0.rc1 lib/github_api/error/service_error.rb
github_api-0.4.11 lib/github_api/error/service_error.rb
github_api-0.4.10 lib/github_api/error/service_error.rb
github_api-0.4.9 lib/github_api/error/service_error.rb
github_api-0.4.8 lib/github_api/error/service_error.rb
github_api-0.4.7 lib/github_api/error/service_error.rb