Sha256: c239e06cb47e5286bf4dbb0e1b308e56eee24c40b4e1a2d186e480a54e08b093

Contents?: true

Size: 593 Bytes

Versions: 73

Compression:

Stored size: 593 Bytes

Contents

class Zendesk2::Error < StandardError

  attr_reader :wrapped_exception, :response
  def initialize(wrapped_exception)
    @wrapped_exception = wrapped_exception
    @response = wrapped_exception.response
    message = if wrapped_exception.is_a?(Faraday::Error::ParsingError)
                wrapped_exception.message
              elsif wrapped_exception.is_a?(Faraday::Error::ClientError)
                wrapped_exception.response.inspect
              else
                wrapped_exception.instance_variable_get(:@wrapped_exception).inspect
              end
    super(message)
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
zendesk2-1.9.0 lib/zendesk2/error.rb
zendesk2-1.8.1 lib/zendesk2/error.rb
zendesk2-1.7.5 lib/zendesk2/error.rb
zendesk2-1.7.4 lib/zendesk2/error.rb
zendesk2-1.7.2 lib/zendesk2/error.rb
zendesk2-1.7.1 lib/zendesk2/error.rb
zendesk2-1.7.0 lib/zendesk2/error.rb
zendesk2-1.6.1 lib/zendesk2/error.rb
zendesk2-1.5.17 lib/zendesk2/error.rb
zendesk2-1.5.16 lib/zendesk2/error.rb
zendesk2-1.5.15 lib/zendesk2/error.rb
zendesk2-1.5.14 lib/zendesk2/error.rb
zendesk2-1.5.13 lib/zendesk2/error.rb
zendesk2-1.5.12 lib/zendesk2/error.rb
zendesk2-1.5.11 lib/zendesk2/error.rb
zendesk2-1.5.10 lib/zendesk2/error.rb
zendesk2-1.5.9 lib/zendesk2/error.rb
zendesk2-1.5.8 lib/zendesk2/error.rb
zendesk2-1.5.7 lib/zendesk2/error.rb
zendesk2-1.5.6 lib/zendesk2/error.rb