Sha256: 8c47777c13e580bfdd23e37c4595738a5066a32078c5bf94933286b0c0485542

Contents?: true

Size: 721 Bytes

Versions: 44

Compression:

Stored size: 721 Bytes

Contents

module TrackerApi
  class 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
end

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
tracker_api-1.1.0 lib/tracker_api/error.rb
tracker_api-1.0.0 lib/tracker_api/error.rb
tracker_api-0.2.12 lib/tracker_api/error.rb
tracker_api-0.2.11 lib/tracker_api/error.rb
v2gpti-1.2.7 tracker_api/lib/tracker_api/error.rb
v2gpti-1.2.6 tracker_api/lib/tracker_api/error.rb
v2gpti-1.2.5 tracker_api/lib/tracker_api/error.rb
v2gpti-1.2.4 tracker_api/lib/tracker_api/error.rb
tracker_api-0.2.10 lib/tracker_api/error.rb
v2gpti-1.2.3 tracker_api/lib/tracker_api/error.rb
v2gpti-1.2.2 tracker_api/lib/tracker_api/error.rb
tracker_api-0.2.9 lib/tracker_api/error.rb
v2gpti-1.2.1 tracker_api/lib/tracker_api/error.rb
v2gpti-1.2.0 tracker_api/lib/tracker_api/error.rb
tracker_api-0.2.8 lib/tracker_api/error.rb
tracker_api-0.2.7 lib/tracker_api/error.rb
tracker_api-0.2.6 lib/tracker_api/error.rb
tracker_api-0.2.5 lib/tracker_api/error.rb
tracker_api-0.2.4 lib/tracker_api/error.rb
tracker_api-0.2.3 lib/tracker_api/error.rb