Sha256: 229118ad237eb78113d12064c2cb4fdc177e700c811a9c08ee547debdbcefc06
Contents?: true
Size: 501 Bytes
Versions: 1
Compression:
Stored size: 501 Bytes
Contents
# encoding: utf-8 require 'faraday' require 'nimbu-api/errors' module Nimbu class Response::RaiseError < Faraday::Response::Middleware def on_complete(env) # status_code = env[:status].to_i # service_error = Nimbu::Error::ServiceError # error_class = service_error.errors[status_code] # error_class = service_error if !error_class and (400...600).include? status_code # raise error_class.new(env) if error_class end end # Response::RaiseError end # Nimbu
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
nimbu-api-0.0.1 | lib/nimbu-api/response/raise_error.rb |