Sha256: 404d47656b86795e66b58b9086811d625821d9322c1d5b106886c707f05d065c
Contents?: true
Size: 819 Bytes
Versions: 8
Compression:
Stored size: 819 Bytes
Contents
require 'faraday' module PaychexFaradayMiddleWare class RaisePaychexHttpException < Faraday::Middleware def initialize(app) super(app) end def call(env) @app.call(env).on_complete do |response| case response.status.to_i when 400 raise Paychex::BadRequest, response when 401 raise Paychex::Unauthorized, response when 403 raise Paychex::NoAccess, response when 404 raise Paychex::NotFound, response when 500 raise Paychex::InternalServerError, response when 502 raise Paychex::BadGateway, response when 503 raise Paychex::ServiceUnavailable, response when 504 raise Paychex::GatewayTimeout, response end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems