Sha256: 72d31b25adf23079738cd3a4e908356c0ed86bc929fe2322e495471f23e4d3b5
Contents?: true
Size: 638 Bytes
Versions: 11
Compression:
Stored size: 638 Bytes
Contents
require 'zendesk_api/error' module ZendeskAPI module Middleware module Response class RaiseError < Faraday::Response::RaiseError def call(env) super rescue Faraday::Error::TimeoutError, Faraday::Error::ConnectionFailed => e raise Error::NetworkError.new(e) end def on_complete(env) case env[:status] when 404 raise Error::RecordNotFound.new(env) when 422 raise Error::RecordInvalid.new(env) when 400...600 raise Error::NetworkError.new(env) end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems