Sha256: 0959d7214433aa771ec5cad4c042776d8da57afbff90f9cbc3654a72d1134795
Contents?: true
Size: 801 Bytes
Versions: 17
Compression:
Stored size: 801 Bytes
Contents
# encoding: utf-8 require 'faraday' require 'github_api/error' module Github class Response::RaiseError < Faraday::Response::Middleware def on_complete(env) case env[:status].to_i when 400 raise Github::Error::BadRequest.new(env) when 401 raise Github::Error::Unauthorized.new(env) when 403 raise Github::Error::Forbidden.new(env) when 404 raise Github::Error::NotFound.new(env) when 422 raise Github::Error::UnprocessableEntity.new(env) when 500 raise Github::Error::InternalServerError.new(env) when 503 raise Github::Error::ServiceUnavailable.new(env) when 400...600 raise Github::Error::ServiceError.new(env) end end end # Response::RaiseError end # Github
Version data entries
17 entries across 17 versions & 1 rubygems