Sha256: e3b0ec655ade04b1868721bf7595fb9a12ad7dfddfc1a9ef7a0c23193330369a

Contents?: true

Size: 517 Bytes

Versions: 6

Compression:

Stored size: 517 Bytes

Contents

module Http
  module Exceptions
    class HttpException < RuntimeError
      attr_reader :response, :original_exception

      def initialize(options = {})
        @original_exception = options[:original_exception]
        @response = options[:response]
        msg = "An error as occured while processing response."
        msg += " Status #{response.code}\n#{response.body}" if response
        msg += " Original Exception: #{original_exception}" if original_exception
        super msg
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
http-exceptions-0.1.2 lib/http/exceptions/http_exception.rb
http-exceptions-0.1.1 lib/http/exceptions/http_exception.rb
http-exceptions-0.1.0 lib/http/exceptions/http_exception.rb
tanga-http-exceptions-0.0.4 lib/http/exceptions/http_exception.rb
http-exceptions-0.0.4 lib/http/exceptions/http_exception.rb
http-exceptions-0.0.3 lib/http/exceptions/http_exception.rb