Sha256: 56610311a908b9ee4c25ca8792633578b2a4b93c906ec10a713e0d92c8dba977

Contents?: true

Size: 435 Bytes

Versions: 19

Compression:

Stored size: 435 Bytes

Contents

require 'faraday'
require 'octokit/error'

module Octokit
  # Faraday response middleware
  module Response

    # This class raises an Octokit-flavored exception based 
    # HTTP status codes returned by the API
    class RaiseError < Faraday::Response::Middleware

      private

      def on_complete(response)
        if error = Octokit::Error.from_response(response)
          raise error
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
octokit-2.7.2 lib/octokit/response/raise_error.rb
octokit-2.7.1 lib/octokit/response/raise_error.rb
octokit-2.7.0 lib/octokit/response/raise_error.rb
octokit-2.6.3 lib/octokit/response/raise_error.rb
octokit-2.6.2 lib/octokit/response/raise_error.rb
octokit-2.6.1 lib/octokit/response/raise_error.rb
octokit-2.6.0 lib/octokit/response/raise_error.rb
octokit-2.5.1 lib/octokit/response/raise_error.rb
octokit-2.5.0 lib/octokit/response/raise_error.rb
octokit-2.4.0 lib/octokit/response/raise_error.rb
octokit-2.3.1 lib/octokit/response/raise_error.rb
octokit-2.3.0 lib/octokit/response/raise_error.rb
octokit-2.2.0 lib/octokit/response/raise_error.rb
octokit-2.1.2 lib/octokit/response/raise_error.rb
octokit-2.1.1 lib/octokit/response/raise_error.rb
octokit-2.1.0 lib/octokit/response/raise_error.rb
octokit-2.0.0 lib/octokit/response/raise_error.rb
octokit-2.0.0.rc4 lib/octokit/response/raise_error.rb
octokit-2.0.0.rc3 lib/octokit/response/raise_error.rb