Module: Zikrash

Defined in:
lib/zikrash.rb,
lib/zikrash/version.rb,
lib/zikrash/send_report.rb,
lib/zikrash/code_extractor.rb,
lib/zikrash/exception_info.rb

Defined Under Namespace

Classes: CodeExtractor, ExceptionInfo, SendReport

Constant Summary collapse

VERSION =
'1.1.0'

Class Method Summary collapse

Class Method Details

.report(project_key, exception, session_info = {}, params_info = {}, additional_reports = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/zikrash.rb', line 9

def report(project_key, exception, session_info = {}, params_info = {},  additional_reports = {})
  return false if project_key.blank? || exception.blank?

  begin
    exception_info = ExceptionInfo.new(exception)
    return false unless exception_info

    send_report = SendReport.new(project_key, exception_info.data, session_info, params_info, additional_reports)

    send_report.let_it_go
  rescue Exception => error
    # Just in case I messed up badly
    Rails.logger.fatal("========== Zikrash Gem Crashed ==========")
    Rails.logger.fatal("Please notify it's developers")
    Rails.logger.fatal("Exception message: #{error.message}")
    Rails.logger.fatal("Exception location: #{error.backtrace.first}")
    Rails.logger.fatal("=========================================\n")
  end
end