Initial commit

This commit is contained in:
Yaser
2026-08-13 19:56:46 +03:30
commit de1d57a67b
474 changed files with 43185 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
def catch_and_report_exception(options = {})
begin
yield
nil
rescue options.fetch(:class) { StandardError } => e
report_exception(e)
e
end
end
def report_exception(exception, report_to_ets = true)
report_exception_to_screen(exception)
report_exception_to_ets(exception) if report_to_ets
end
def report_exception_to_screen(exception)
Rails.logger.unknown exception.inspect
Rails.logger.unknown exception.backtrace.join("\n") if exception.respond_to?(:backtrace)
end
def report_exception_to_ets(exception)
Raven.capture_exception(exception) if defined?(Raven)
rescue => ets_exception
report_exception(ets_exception, false)
end