Sha256: e64589e0ff498975bf6a21e759997c2b0da5f27920a13f02f5ab4fd6985447ea

Contents?: true

Size: 1002 Bytes

Versions: 13

Compression:

Stored size: 1002 Bytes

Contents

module Errplane
  class Transmitter
    def initialize(params = {})
    end

    def relay(black_box)
      http = initialize_http_connection
      data = black_box.to_json
      response = begin
                   url = "/api/v1/applications/#{Errplane.configuration.application_id}/exceptions/#{Errplane.configuration.rails_environment}?api_key=#{Errplane.configuration.api_key}"
                   ::Rails.logger.info("\nURL: #{url}")
                   ::Rails.logger.info("\nData: #{data.inspect}")
                   response = http.post(url, data)
                   ::Rails.logger.info("\nException Response: #{response.inspect}")
                   response
                 rescue Exception => e
                   # e
                 end

      case response
      when Net::HTTPSuccess
        # Success
      else
        # Failure
      end
    end

    private
    def initialize_http_connection
      connection = Net::HTTP.new(Errplane.configuration.api_host, "80")
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
errplane-0.1.9 lib/errplane/transmitter.rb
errplane-0.1.8 lib/errplane/transmitter.rb
errplane-0.1.7 lib/errplane/transmitter.rb
errplane-0.1.6 lib/errplane/transmitter.rb
errplane-0.1.5 lib/errplane/transmitter.rb
errplane-0.1.4 lib/errplane/transmitter.rb
errplane-0.1.3 lib/errplane/transmitter.rb
errplane-0.1.2 lib/errplane/transmitter.rb
errplane-0.1.1 lib/errplane/transmitter.rb
errplane-0.1.0 lib/errplane/transmitter.rb
errplane-0.0.6 lib/errplane/transmitter.rb
errplane-0.0.5 lib/errplane/transmitter.rb
errplane-0.0.4 lib/errplane/transmitter.rb