Module: Bugloco

Defined in:
lib/bugloco.rb,
lib/bugloco/rack.rb,
lib/bugloco/cache.rb,
lib/bugloco/notice.rb,
lib/bugloco/railtie.rb,
lib/bugloco/version.rb,
lib/bugloco/configuration.rb,
lib/bugloco/rails/middleware.rb,
lib/bugloco/protobuf/bugloco.pb.rb

Defined Under Namespace

Modules: Proto, Rails Classes: Cache, Configuration, Notice, Rack, Railtie

Constant Summary collapse

HTTP_ERRORS =
[
Timeout::Error,
Errno::EINVAL,
Errno::ECONNRESET,
EOFError,
Net::HTTPBadResponse,
Net::HTTPHeaderSyntaxError,
Net::ProtocolError,
Errno::ECONNREFUSED,
OpenSSL::SSL::SSLError].freeze
VERSION =
"0.0.8"

Class Method Summary collapse

Class Method Details

.config {|@configuration| ... } ⇒ Object

Yields:

  • (@configuration)


44
45
46
47
48
# File 'lib/bugloco.rb', line 44

def config
  @configuration ||= Bugloco::Configuration.new
  yield(@configuration) if block_given?
  @configuration
end

.report_notice(notice) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/bugloco.rb', line 30

def report_notice(notice)
  encoded_notice = notice.to_pb
  encoded_response = send_notice(encoded_notice)

  if encoded_response
    response = Bugloco::Proto::Response.new.
      parse_from_string(encoded_response)

    response
  else
    nil
  end
end

.report_notice_or_ignore(exception, options = {}) ⇒ Object



23
24
25
26
27
28
# File 'lib/bugloco.rb', line 23

def report_notice_or_ignore(exception, options = {})
  return nil unless Bugloco.config.send_notice

  notice = Bugloco::Notice.new(exception, options)
  report_notice(notice) unless notice.ignore?
end