in lib/facebook_ads/crash_logger.rb [28:62]
def logCrash
error = $!
if is_facebook_error(error)
app_id = get_app_id
if app_id.nil?
puts "Unable to log the crash: We're missing an app id."
return
end
params = {
'bizsdk_crash_report': {
'reason': formatted_reason(error),
'platform': "ruby #{RUBY_VERSION}",
'callstack': error.backtrace
}
}
begin
APIRequest.new(
:post,
"#{app_id}/instruments",
session: Session.anonymous_session,
params: params,
options: {}
).execute do |response|
if response.result.has_key?('success') && response.result['success'] == true
puts 'Successfully sent report'
return
end
puts 'Failed to send report'
end
rescue
puts 'Failed to send report'
end
end
end