Sha256: 7bc286554a6eab88a12aee1678c0a02168f233bd527e62ef2887b585c8c7969a
Contents?: true
Size: 784 Bytes
Versions: 6
Compression:
Stored size: 784 Bytes
Contents
# tested via spec/core/middleware/response/raise_error_spec.rb module ZendeskAPI module Error class ClientError < Faraday::Error::ClientError attr_reader :wrapped_exception def to_s if response "#{super} -- #{response.method} #{response.url}" else super end end end class RecordInvalid < ClientError attr_accessor :errors def initialize(*) super if response[:body].is_a?(Hash) @errors = response[:body]["details"] || response[:body]["description"] end @errors ||= {} end def to_s "#{self.class.name}: #{@errors}" end end class NetworkError < ClientError; end class RecordNotFound < ClientError; end end end
Version data entries
6 entries across 6 versions & 1 rubygems