Sha256: 137195334e2e0f68701c26eed91a8077fb135b47e129ce77aeb1694b258ccfca

Contents?: true

Size: 326 Bytes

Versions: 8

Compression:

Stored size: 326 Bytes

Contents

# frozen_string_literal: true

module Mock
  module Twilio
    class ErrorHandler
      def initialize(response)
        @response = response
      end

      def raise
        return @response.body if @response.headers["content-type"].include?("application/json")

        @response.reason_phrase
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mock-twilio-1.4 lib/mock/twilio/util/error_handler.rb
mock-twilio-1.3.2 lib/mock/twilio/util/error_handler.rb
mock-twilio-1.3.1 lib/mock/twilio/util/error_handler.rb
mock-twilio-1.3.0 lib/mock/twilio/util/error_handler.rb
mock-twilio-1.2.0 lib/mock/twilio/util/error_handler.rb
mock-twilio-1.1.0 lib/mock/twilio/util/error_handler.rb
mock-twilio-1.0.0 lib/mock/twilio/util/error_handler.rb
mock-twilio-0.8.0 lib/mock/twilio/util/error_handler.rb